Let save_options create folder if it doesn't exist
This commit is contained in:
parent
da7099a924
commit
5e2cef2cde
1 changed files with 4 additions and 0 deletions
|
|
@ -25,6 +25,10 @@ def save_options(options, path, ignore=None):
|
||||||
options_copy[i] = 'Removed'
|
options_copy[i] = 'Removed'
|
||||||
|
|
||||||
|
|
||||||
|
if not os.path.isdir(os.path.dirname(path)):
|
||||||
|
os.makedirs(os.path.dirname(path))
|
||||||
|
|
||||||
|
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
json.dump(options_copy,f, skipkeys=True, indent=4)
|
json.dump(options_copy,f, skipkeys=True, indent=4)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue