mirror of
https://github.com/revanced/revanced-static-api.git
synced 2025-04-29 22:24:37 +02:00
fix: add tags to index files
This commit is contained in:
parent
dc1d95d298
commit
ba9a868394
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user