mirror of
https://github.com/zen-browser/theme-store.git
synced 2025-07-08 01:10:01 +02:00
chore: Update create-theme workflow to handle preferences file
This commit is contained in:
parent
34c19e2524
commit
57d355020d
2 changed files with 13 additions and 7 deletions
1
.github/workflows/create-theme.yml
vendored
1
.github/workflows/create-theme.yml
vendored
|
@ -48,6 +48,7 @@ jobs:
|
||||||
|
|
||||||
- name: Write preferences to file
|
- name: Write preferences to file
|
||||||
uses: "DamianReeves/write-file-action@master"
|
uses: "DamianReeves/write-file-action@master"
|
||||||
|
if: fromJson(steps.issue-parser.outputs.jsonString)['preferences'] != ''
|
||||||
with:
|
with:
|
||||||
contents: ${{ fromJson(steps.issue-parser.outputs.jsonString)['preferences'] }}
|
contents: ${{ fromJson(steps.issue-parser.outputs.jsonString)['preferences'] }}
|
||||||
path: theme-preferences.json
|
path: theme-preferences.json
|
||||||
|
|
|
@ -150,13 +150,18 @@ Just joking, you can do whatever you want. You're the boss.
|
||||||
with open(f"themes/{theme_id}/{README_FILE}", 'w') as f:
|
with open(f"themes/{theme_id}/{README_FILE}", 'w') as f:
|
||||||
f.write(get_readme())
|
f.write(get_readme())
|
||||||
|
|
||||||
with open(f"themes/{theme_id}/{PREFERENCES_FILE}", 'w') as f:
|
if os.path.exists(TEMPLATE_PREFERENCES_FILE):
|
||||||
prefs = get_preferences()
|
prefs_file = f"themes/{theme_id}/{PREFERENCES_FILE}"
|
||||||
if len(prefs) > 0:
|
with open(prefs_file, 'w') as f:
|
||||||
print("Detected preferences file. Please review the preferences below.")
|
prefs = get_preferences()
|
||||||
print(prefs)
|
if len(prefs) > 0:
|
||||||
theme['preferences'] = get_static_asset(theme_id, PREFERENCES_FILE)
|
print("Detected preferences file. Please review the preferences below.")
|
||||||
json.dump(prefs, f)
|
print(prefs)
|
||||||
|
theme['preferences'] = get_static_asset(theme_id, PREFERENCES_FILE)
|
||||||
|
json.dump(prefs, f)
|
||||||
|
else:
|
||||||
|
print("No preferences detected.")
|
||||||
|
os.remove(prefs_file)
|
||||||
|
|
||||||
download_image(image, f"themes/{theme_id}/{IMAGE_FILE}")
|
download_image(image, f"themes/{theme_id}/{IMAGE_FILE}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue