From c8bfeb2fa3a0c5c589502e825277ac65b545f2bd Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 24 Jan 2019 14:19:59 +0100 Subject: [PATCH 1/2] do not execute actions when installing to temp --- dotdrop/dotdrop.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index ee8e2f0..898b911 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -102,7 +102,7 @@ def cmd_install(opts, conf, temporary=False, keys=[]): installed = [] for dotfile in dotfiles: preactions = [] - if dotfile.actions and Cfg.key_actions_pre in dotfile.actions: + if not temporary and dotfile.actions and Cfg.key_actions_pre in dotfile.actions: for action in dotfile.actions[Cfg.key_actions_pre]: preactions.append(action) if opts['debug']: @@ -124,7 +124,7 @@ def cmd_install(opts, conf, temporary=False, keys=[]): if os.path.exists(tmp): remove(tmp) if len(r) > 0: - if Cfg.key_actions_post in dotfile.actions: + if not temporary and Cfg.key_actions_post in dotfile.actions: actions = dotfile.actions[Cfg.key_actions_post] # execute action for action in actions: @@ -136,7 +136,7 @@ def cmd_install(opts, conf, temporary=False, keys=[]): action.execute() installed.extend(r) if temporary: - LOG.log('\nInstalled to tmp {}.'.format(tmpdir)) + LOG.log('\nInstalled to tmp \"{}\".'.format(tmpdir)) LOG.log('\n{} dotfile(s) installed.'.format(len(installed))) return True From 46e659a13877b8d6ecb0ea8489e48cac3f5da486 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 24 Jan 2019 15:39:00 +0100 Subject: [PATCH 2/2] pep8 fix --- dotdrop/dotdrop.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index 898b911..07c8f83 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -102,7 +102,8 @@ def cmd_install(opts, conf, temporary=False, keys=[]): installed = [] for dotfile in dotfiles: preactions = [] - if not temporary and dotfile.actions and Cfg.key_actions_pre in dotfile.actions: + if not temporary and dotfile.actions \ + and Cfg.key_actions_pre in dotfile.actions: for action in dotfile.actions[Cfg.key_actions_pre]: preactions.append(action) if opts['debug']: