diff options
author | Anish Athalye <me@anishathalye.com> | 2018-11-21 19:50:46 -0500 |
---|---|---|
committer | Anish Athalye <me@anishathalye.com> | 2018-11-21 19:50:46 -0500 |
commit | 5e2d40939e567a68eb8f4eecc23752df6f183664 (patch) | |
tree | 249a18e202fd1a86fd24841a10db8210d9dfd003 /dotbot | |
parent | 8558a5dca0232879c95243747f94a2bf7b8869e4 (diff) | |
parent | dc057866935db382d3be8559d7079b122235ff51 (diff) |
Merge branch 'thtliife/suppress-shell-cmd'
Diffstat (limited to 'dotbot')
-rw-r--r-- | dotbot/plugins/shell.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dotbot/plugins/shell.py b/dotbot/plugins/shell.py index b6f5184..06a9a89 100644 --- a/dotbot/plugins/shell.py +++ b/dotbot/plugins/shell.py @@ -22,12 +22,15 @@ class Shell(dotbot.Plugin): with open(os.devnull, 'w') as devnull: for item in data: stdin = stdout = stderr = devnull + quiet = False if defaults.get('stdin', False) == True: stdin = None if defaults.get('stdout', False) == True: stdout = None if defaults.get('stderr', False) == True: stderr = None + if defaults.get('quiet', False) == True: + quiet = True if isinstance(item, dict): cmd = item['command'] msg = item.get('description', None) @@ -37,6 +40,8 @@ class Shell(dotbot.Plugin): stdout = None if item['stdout'] == True else devnull if 'stderr' in item: stderr = None if item['stderr'] == True else devnull + if 'quiet' in item: + quiet = True if item['quiet'] == True else False elif isinstance(item, list): cmd = item[0] msg = item[1] if len(item) > 1 else None @@ -45,6 +50,8 @@ class Shell(dotbot.Plugin): msg = None if msg is None: self._log.lowinfo(cmd) + elif quiet: + self._log.lowinfo('%s' % msg) else: self._log.lowinfo('%s [%s]' % (msg, cmd)) executable = os.environ.get('SHELL') |