diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-14 21:36:08 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-14 21:36:08 -0500 |
| commit | 5a22ebcdb6a9f7fd8de51c52b1548d88f84adbd2 (patch) | |
| tree | a7bb6382a29004088585a7828548c9b538c85e0e /scripts/theme-studio/build-theme.el | |
| parent | 59f4f54e518db3323cd7aaabfdc48ecb2bdaf40d (diff) | |
| download | dotemacs-5a22ebcdb6a9f7fd8de51c52b1548d88f84adbd2.tar.gz dotemacs-5a22ebcdb6a9f7fd8de51c52b1548d88f84adbd2.zip | |
fix(theme-studio): name exported themes from the source filename
The converter took the theme name from the JSON's internal name field, so every draft whose field read "theme" overwrote theme-theme.el. It now uses the JSON file's basename, so WIP.json becomes WIP-theme.el and each draft lands under its own name. The reload target derives the load name from the basename too, and a regression test pins it: the filename wins over the internal field.
Diffstat (limited to 'scripts/theme-studio/build-theme.el')
| -rw-r--r-- | scripts/theme-studio/build-theme.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/theme-studio/build-theme.el b/scripts/theme-studio/build-theme.el index 786a3d960..827129976 100644 --- a/scripts/theme-studio/build-theme.el +++ b/scripts/theme-studio/build-theme.el @@ -246,11 +246,13 @@ Signal a `file-missing' error when JSON-FILE does not exist." (defun build-theme/convert-file (json-file &optional out-dir) "Convert JSON-FILE (a theme.json export) into a deftheme file. -Write themes/<name>-theme.el, where <name> is the JSON name field, into -OUT-DIR (default: the themes/ directory of this repo). Return the written -path." +Write themes/<name>-theme.el, where <name> is JSON-FILE's basename, into +OUT-DIR (default: the themes/ directory of this repo). The basename names the +theme so each export lands under its own file (sterling.json -> sterling-theme.el), +rather than colliding on whatever the JSON's internal name field happens to be. +Return the written path." (let* ((data (build-theme/--parse json-file)) - (name (build-theme/--obj-get data 'name)) + (name (file-name-base json-file)) (specs (build-theme/--all-specs data)) (dir (or out-dir (expand-file-name |
