mirror of
https://github.com/zen-browser/theme-store.git
synced 2025-07-07 08:55:31 +02:00
chore: Ensure packages have version in theme.json
This commit is contained in:
parent
3c5f0bcf15
commit
fea6e8e7b8
2 changed files with 9 additions and 0 deletions
6
scripts/_ensure_packages_have_version.py
Normal file
6
scripts/_ensure_packages_have_version.py
Normal 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
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue