diff options
Diffstat (limited to 'yoyo/config.py')
-rw-r--r-- | yoyo/config.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/yoyo/config.py b/yoyo/config.py index 6d05f22..0569a12 100644 --- a/yoyo/config.py +++ b/yoyo/config.py @@ -206,3 +206,12 @@ def find_config(): return path d = os.path.dirname(d) return None + + +def config_changed(config: ConfigParser, path: str) -> bool: + def to_dict(config: ConfigParser): + return {k: dict(section.items()) for k, section in config.items()} + + if Path(path).exists(): + return to_dict(read_config(path)) != to_dict(config) + return True |