diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-11-15 16:25:57 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-11-15 16:25:57 +0100 |
commit | 79c9c0747e876c0b97a4fb3fe91fa9825e462722 (patch) | |
tree | ff298dd32dfccfde9921d0ac2c48bc36113a55c6 /dotbot/dispatcher.py | |
parent | 5ffd208bdb85215cc7c5ba6f2903bfa7756aa945 (diff) |
Add a dry run mode.
Diffstat (limited to 'dotbot/dispatcher.py')
-rw-r--r-- | dotbot/dispatcher.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dotbot/dispatcher.py b/dotbot/dispatcher.py index f809bef..9c55050 100644 --- a/dotbot/dispatcher.py +++ b/dotbot/dispatcher.py @@ -4,12 +4,13 @@ from .messenger import Messenger from .context import Context class Dispatcher(object): - def __init__(self, base_directory, only=None, skip=None): + def __init__(self, base_directory, only=None, skip=None, dry_run = False): self._log = Messenger() self._setup_context(base_directory) self._load_plugins() self._only = only self._skip = skip + self._dry_run = dry_run def _setup_context(self, base_directory): path = os.path.abspath( @@ -34,7 +35,7 @@ class Dispatcher(object): for plugin in self._plugins: if plugin.can_handle(action): try: - success &= plugin.handle(action, task[action]) + success &= plugin.handle(action, task[action], self._dry_run) handled = True except Exception as err: self._log.error( |