1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 09:03:00 +00:00

refactor installer

This commit is contained in:
deadc0de6
2020-11-17 13:42:53 +01:00
parent 89d6a1b6ed
commit e4d2d272a8
8 changed files with 132 additions and 217 deletions

View File

@@ -198,17 +198,19 @@ def _dotfile_install(o, dotfile, tmpdir=None):
if hasattr(dotfile, 'link') and dotfile.link == LinkTypes.LINK:
# link
r, err = inst.link(t, dotfile.src, dotfile.dst,
actionexec=pre_actions_exec,
template=dotfile.template,
chmod=dotfile.chmod)
r, err = inst.install(t, dotfile.src, dotfile.dst,
dotfile.link,
actionexec=pre_actions_exec,
template=dotfile.template,
chmod=dotfile.chmod)
elif hasattr(dotfile, 'link') and \
dotfile.link == LinkTypes.LINK_CHILDREN:
# link_children
r, err = inst.link_children(t, dotfile.src, dotfile.dst,
actionexec=pre_actions_exec,
template=dotfile.template,
chmod=dotfile.chmod)
r, err = inst.install(t, dotfile.src, dotfile.dst,
dotfile.link,
actionexec=pre_actions_exec,
template=dotfile.template,
chmod=dotfile.chmod)
else:
# nolink
src = dotfile.src
@@ -221,6 +223,7 @@ def _dotfile_install(o, dotfile, tmpdir=None):
ignores = list(set(o.install_ignore + dotfile.instignore))
ignores = patch_ignores(ignores, dotfile.dst, debug=o.debug)
r, err = inst.install(t, src, dotfile.dst,
LinkTypes.NOLINK,
actionexec=pre_actions_exec,
noempty=dotfile.noempty,
ignore=ignores,