Create config folder if it does not exist

fixes #40
pull/48/head
Ivan Habunek 2018-01-15 23:14:20 +01:00
rodzic ddd4326f7e
commit 05a06acf8e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
2 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -3,6 +3,7 @@ Changelog
**0.17.1 (2017-01-15)**
* Create config folder if it does not exist (#40)
* Fix packaging to include `toot.ui` package (#41)
**0.17.0 (2017-01-15)**

Wyświetl plik

@ -4,6 +4,7 @@ import os
import json
from functools import wraps
from os.path import dirname
from toot import User, App
from toot.config_legacy import load_legacy_config
@ -47,6 +48,10 @@ def make_config(path):
}
print_out("Creating config file at <blue>{}</blue>".format(path))
# Ensure dir exists
os.makedirs(dirname(path), exist_ok=True)
with open(path, 'w') as f:
json.dump(config, f, indent=True)