diff --git a/spyglass.py b/spyglass.py index 93ccabe..1a45d01 100755 --- a/spyglass.py +++ b/spyglass.py @@ -60,7 +60,7 @@ def store_project(project: dict): if not os.path.exists(database): with open(database, 'w') as f: - f.write('projects:') + f.write('projects: []') data = None with open(database, 'r') as f: data = yaml.safe_load(f) @@ -74,6 +74,8 @@ def store_project(project: dict): else: print('Project already exists') + data = { 'projects' : project_list } + with open(database, 'w') as f: yaml.safe_dump(data, f)