Update themes.json with past version if available, otherwise set it to 1.0.0

This commit is contained in:
Mauro Balades 2024-08-25 13:04:52 +02:00
parent 4d6424f9ea
commit a23e634a6e
2 changed files with 130 additions and 125 deletions

View file

@ -61,9 +61,14 @@ def main():
past_version = themes_data[theme].get('version', None)
themes_data[theme] = theme_data
if past_version is not None:
print(f" Found past version: {past_version}")
themes_data[theme]['version'] = past_version
else:
print(f" No past version found, setting to 1.0.0")
themes_data[theme]['version'] = "1.0.0"
with open(THEMES_DATA_FILE, 'w') as f:
json.dump(themes_data, f, indent=4)
del themes_data
print(f"Rebuilt theme: {theme}")
print("Rebuilt all themes!")