chore: Ensure packages have version in theme.json

This commit is contained in:
Mauro Balades 2024-08-25 09:01:07 +02:00
parent 3c5f0bcf15
commit fea6e8e7b8
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,6 @@
def ensure_packages_have_version(theme_data):
if 'version' not in theme_data:
print(" Version is required in theme.json. Adding default value of 1.0.0.")
theme_data['version'] = '1.0.0'
return theme_data

View file

@ -2,6 +2,8 @@
import os
import json
import _ensure_packages_have_version
THEMES_FOLDER = './themes'
THEMES_DATA_FILE = './themes.json'
@ -46,6 +48,7 @@ def main():
continue
with open(theme_data_file, 'r') as f:
theme_data = json.load(f)
theme_data = _ensure_packages_have_version.ensure_packages_have_version(theme_data)
with open(THEMES_DATA_FILE, 'r') as f:
themes_data = json.load(f)
theme_colors_file = os.path.join(theme_folder, 'colors.json')