mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-11 00:58:31 +02:00
make update of new settings a bit more general and remove some whitespace
* config.update(default_config) does not work, would overwrite all values
This commit is contained in:
parent
530514c7ac
commit
e8435a0445
1 changed files with 11 additions and 7 deletions
8
jrnl.py
8
jrnl.py
|
@ -357,8 +357,12 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
with open(CONFIG_PATH) as f:
|
with open(CONFIG_PATH) as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
if not 'highlight' in config:
|
|
||||||
config['highlight'] = False
|
# update config file with settings introduced in a later version
|
||||||
|
missing_keys = set(default_config).difference(config)
|
||||||
|
if missing_keys:
|
||||||
|
for key in missing_keys:
|
||||||
|
config[key] = default_config[key]
|
||||||
with open(CONFIG_PATH, 'w') as f:
|
with open(CONFIG_PATH, 'w') as f:
|
||||||
json.dump(config, f, indent=2)
|
json.dump(config, f, indent=2)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue