mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 16:59:16 +00:00
do not execute action when --dry
This commit is contained in:
@@ -91,8 +91,11 @@ def install(opts, conf):
|
|||||||
for dotfile in dotfiles:
|
for dotfile in dotfiles:
|
||||||
if dotfile.actions and Cfg.key_actions_pre in dotfile.actions:
|
if dotfile.actions and Cfg.key_actions_pre in dotfile.actions:
|
||||||
for action in dotfile.actions[Cfg.key_actions_pre]:
|
for action in dotfile.actions[Cfg.key_actions_pre]:
|
||||||
LOG.dbg('executing pre action {}'.format(action))
|
if opts['dry']:
|
||||||
action.execute()
|
LOG.dry('would execute action: {}'.format(action))
|
||||||
|
else:
|
||||||
|
LOG.dbg('executing pre action {}'.format(action))
|
||||||
|
action.execute()
|
||||||
LOG.dbg('installing {}'.format(dotfile))
|
LOG.dbg('installing {}'.format(dotfile))
|
||||||
if hasattr(dotfile, 'link') and dotfile.link:
|
if hasattr(dotfile, 'link') and dotfile.link:
|
||||||
r = inst.link(dotfile.src, dotfile.dst)
|
r = inst.link(dotfile.src, dotfile.dst)
|
||||||
@@ -126,8 +129,11 @@ def install(opts, conf):
|
|||||||
actions = dotfile.actions[Cfg.key_actions_post]
|
actions = dotfile.actions[Cfg.key_actions_post]
|
||||||
# execute action
|
# execute action
|
||||||
for action in actions:
|
for action in actions:
|
||||||
LOG.dbg('executing post action {}'.format(action))
|
if opts['dry']:
|
||||||
action.execute()
|
LOG.dry('would execute action: {}'.format(action))
|
||||||
|
else:
|
||||||
|
LOG.dbg('executing post action {}'.format(action))
|
||||||
|
action.execute()
|
||||||
installed.extend(r)
|
installed.extend(r)
|
||||||
LOG.log('\n{} dotfile(s) installed.'.format(len(installed)))
|
LOG.log('\n{} dotfile(s) installed.'.format(len(installed)))
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user