Always touch config file dir if dne
parent
79fcbcc281
commit
c088963cf2
|
@ -197,6 +197,9 @@ def load(
|
||||||
'''
|
'''
|
||||||
path = path or get_conf_path(conf_name)
|
path = path or get_conf_path(conf_name)
|
||||||
|
|
||||||
|
if not os.path.isdir(_config_dir):
|
||||||
|
os.mkdir(_config_dir)
|
||||||
|
|
||||||
if not os.path.isfile(path):
|
if not os.path.isfile(path):
|
||||||
fn = _conf_fn_w_ext(conf_name)
|
fn = _conf_fn_w_ext(conf_name)
|
||||||
|
|
||||||
|
@ -210,8 +213,8 @@ def load(
|
||||||
if os.path.isfile(template):
|
if os.path.isfile(template):
|
||||||
shutil.copyfile(template, path)
|
shutil.copyfile(template, path)
|
||||||
else:
|
else:
|
||||||
with open(path, 'w'):
|
with open(path, 'r'):
|
||||||
pass # touch
|
pass # touch it
|
||||||
|
|
||||||
config = toml.load(path, **tomlkws)
|
config = toml.load(path, **tomlkws)
|
||||||
log.debug(f"Read config file {path}")
|
log.debug(f"Read config file {path}")
|
||||||
|
|
Loading…
Reference in New Issue