From 79c9c0747e876c0b97a4fb3fe91fa9825e462722 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 15 Nov 2020 16:25:57 +0100 Subject: Add a dry run mode. --- dotbot/dispatcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dotbot/dispatcher.py') 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( -- cgit v1.2.3