1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-15 16:15:05 +00:00

do not execute action when --dry

This commit is contained in:
deadc0de6
2018-06-08 22:44:42 +02:00
parent 952230ef47
commit 0328efedee

View File

@@ -91,6 +91,9 @@ def install(opts, conf):
for dotfile in dotfiles:
if dotfile.actions and Cfg.key_actions_pre in dotfile.actions:
for action in dotfile.actions[Cfg.key_actions_pre]:
if opts['dry']:
LOG.dry('would execute action: {}'.format(action))
else:
LOG.dbg('executing pre action {}'.format(action))
action.execute()
LOG.dbg('installing {}'.format(dotfile))
@@ -126,6 +129,9 @@ def install(opts, conf):
actions = dotfile.actions[Cfg.key_actions_post]
# execute action
for action in actions:
if opts['dry']:
LOG.dry('would execute action: {}'.format(action))
else:
LOG.dbg('executing post action {}'.format(action))
action.execute()
installed.extend(r)