refactor(scripts): added compatibility layer with old prefs style, convert prefs to new style on theme rebuild (#424)

* refactor(scripts): replaced hyphens with underscores in script names

* test(rebuild_themes): debug logs

* Rebuild themes.json after theme submission

* refactor(rebuild_themes): added preferences loading

* fix(submit-pr): fixed dependencies

* debug(rebuild_themes): add pre print

* feature(rebuild_themes): save preferences to file

* feature(rebuild_themes): add ident

* Rebuild themes.json after theme submission

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Bryan Galdámez 2024-09-20 22:58:24 -06:00 committed by GitHub
parent 640f563c73
commit 80842c45a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 647 additions and 178 deletions

View file

@ -0,0 +1,18 @@
import os
import json
if __name__ == "__main__":
for themeId in os.listdir("themes"):
themeFolder = os.path.join("themes", themeId)
if not os.path.isdir(themeFolder):
continue
themeDataFile = os.path.join(themeFolder, "theme.json")
if not os.path.exists(themeDataFile):
continue
with open(themeDataFile, "r") as f:
themeData = json.load(f)
if "version" not in themeData:
themeData["version"] = "1.0.0"
with open(themeDataFile, "w") as f:
json.dump(themeData, f, indent=4)
print(f"Added version to theme: {themeId}")