From ba9a868394ef4baf4fac03e22f9886d3e1f2f6b5 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 10 Apr 2023 07:55:03 +0200 Subject: [PATCH] fix: add tags to index files --- src/app/generator.py | 2 +- src/app/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/generator.py b/src/app/generator.py index dc3c540..dc58886 100644 --- a/src/app/generator.py +++ b/src/app/generator.py @@ -50,7 +50,7 @@ class ReleaseApi(Api): # At last join the current tag to an index file index_path = join(path, f'{repository_name}.json') - index = read_json(index_path) + index = read_json(index_path, []) if tag not in index: # TODO: Check if there a better way to do this index.append(tag) # Add the current tag to the index diff --git a/src/app/utils.py b/src/app/utils.py index 2cb34d8..643bdf2 100644 --- a/src/app/utils.py +++ b/src/app/utils.py @@ -8,7 +8,7 @@ def write_json(text: str | dict | list, to, overwrite=True): text = json.dumps(text) f.write(text) -def read_json(path, default=[]): +def read_json(path, default): if os.path.exists(path): with open(path, 'r') as f: return json.load(f)