Skip to content

Commit

Permalink
Remove themes_custom.json
Browse files Browse the repository at this point in the history
The themes which were in themes_custom.json are now in the main
themes.json file. This commit removes the themes_custom.json file,
and updates the Makefile and THEMES.md file to reflect this change.
  • Loading branch information
joshka committed Oct 9, 2023
1 parent 28e710f commit 6b4b307
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 51 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
themes.json:
# this is the url used by https://windowsterminalthemes.dev/
# See https://github.com/atomcorp/themes/blob/master/app/src/App.tsx#L18
@./scripts/download_theme.sh \
https://2zrysvpla9.execute-api.eu-west-2.amazonaws.com/prod/themes \
themes

themes_custom.json:
@./scripts/download_theme.sh \
https://raw.githubusercontent.com/atomcorp/themes/master/app/src/custom-colour-schemes.json \
themes_custom

THEMES.md:
@go run . themes --markdown 2> THEMES.md

all: themes.json themes_custom.json THEMES.md
all: themes.json THEMES.md
@echo "Running all"

refresh:
Expand Down
38 changes: 0 additions & 38 deletions THEMES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions themes.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ func uintPtr(u uint) *uint { return &u }
var (
//go:embed themes.json
themesBts []byte

//go:embed themes_custom.json
customThemesBts []byte
)

// ThemeNotFoundError is returned when a requested theme is not found.
Expand All @@ -146,7 +143,7 @@ func (e ThemeNotFoundError) Error() string {
// sortedThemeNames returns the names of the themes, sorted.
func sortedThemeNames() ([]string, error) {
var keys []string
for _, bts := range [][]byte{themesBts, customThemesBts} {
for _, bts := range [][]byte{themesBts} {
themes, err := parseThemes(bts)
if err != nil {
return nil, err
Expand All @@ -166,7 +163,7 @@ const distance = 2

// findTheme return the given theme, if it exists.
func findTheme(name string) (Theme, error) {
for _, bts := range [][]byte{themesBts, customThemesBts} {
for _, bts := range [][]byte{themesBts} {
themes, err := parseThemes(bts)
if err != nil {
return DefaultTheme, err
Expand Down
Loading

0 comments on commit 6b4b307

Please sign in to comment.