mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-08 11:15:52 +00:00
Avoid error when status_path dir doesn't exist
This commit is contained in:
parent
3e7bb377cc
commit
b6d3b9908b
1 changed files with 6 additions and 1 deletions
|
|
@ -74,7 +74,12 @@ def load_status(basepath, pair_name):
|
|||
|
||||
|
||||
def save_status(basepath, pair_name, status):
|
||||
full_path = os.path.join(expand_path(basepath), pair_name)
|
||||
base_path = expand_path(basepath)
|
||||
full_path = os.path.join(base_path, pair_name)
|
||||
|
||||
if not os.path.exists(base_path):
|
||||
os.makedirs(base_path)
|
||||
|
||||
with open(full_path, 'w+') as f:
|
||||
for k, v in status.items():
|
||||
json.dump((k, v), f)
|
||||
|
|
|
|||
Loading…
Reference in a new issue