mirror of
https://github.com/zen-browser/theme-store.git
synced 2025-07-07 08:55:31 +02:00
Fix Theme Metadata Duplication and Add Missing Properties for Recent Pull Requests (#575)
* fix ability to add tags multiple times when rebuilding themes * fix `createdAt` not being added for pull requests made prior * adds tags property if it doesn't exist (old PRs) * updated affected `theme.json` files * updated more affected `theme.json` files * fix action failing if new commits before finished * make action only initiate when themes are changed
This commit is contained in:
parent
65c8c1fed0
commit
a73edd785e
13 changed files with 53 additions and 14 deletions
|
@ -21,9 +21,23 @@ def update_theme_date(theme_path):
|
|||
theme_data = json.load(f)
|
||||
except json.JSONDecodeError as e:
|
||||
panic("Error reading theme.json: " + str(e))
|
||||
|
||||
# Get the current date
|
||||
current_date = time.strftime("%Y-%m-%d")
|
||||
|
||||
# Set `createdAt` to the current date if it doesn't exist
|
||||
if "createdAt" not in theme_data:
|
||||
theme_data["createdAt"] = current_date
|
||||
print(f"Set `createdAt` for {theme_path} to {theme_data['createdAt']}")
|
||||
|
||||
# Update the `updatedAt` field to the current date
|
||||
theme_data["updatedAt"] = time.strftime("%Y-%m-%d")
|
||||
theme_data["updatedAt"] = current_date
|
||||
print(f"Updated `updatedAt` for {theme_path} to {theme_data['updatedAt']}")
|
||||
|
||||
# Add `tags` as an empty list if it doesn't exist
|
||||
if "tags" not in theme_data:
|
||||
theme_data["tags"] = []
|
||||
print(f"Initialized `tags` for {theme_path} as an empty list")
|
||||
|
||||
# Write the changes back to theme.json
|
||||
with open(theme_file, "w") as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue