1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 17:12:59 +00:00

fix dry for 237

This commit is contained in:
deadc0de6
2020-06-11 22:56:12 +02:00
parent 18a61bce60
commit 9ccf27765f
3 changed files with 33 additions and 20 deletions

View File

@@ -28,7 +28,7 @@ class CfgAggregator:
dir_prefix = 'd'
key_sep = '_'
def __init__(self, path, profile_key, debug=False):
def __init__(self, path, profile_key, debug=False, dry=False):
"""
high level config parser
@path: path to the config file
@@ -38,6 +38,7 @@ class CfgAggregator:
self.path = path
self.profile_key = profile_key
self.debug = debug
self.dry = dry
self.log = Logger()
self._load()
@@ -175,8 +176,8 @@ class CfgAggregator:
msg = 'new dotfile {} to profile {}'
self.log.dbg(msg.format(key, self.profile_key))
self.cfgyaml.save()
if ret:
self.save()
if ret and not self.dry:
# reload
if self.debug:
self.log.dbg('reloading config')
@@ -291,6 +292,8 @@ class CfgAggregator:
def save(self):
"""save the config"""
if self.dry:
return True
return self.cfgyaml.save()
def dump(self):