Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (43 loc) · 2.41 KB
/
Copy pathMakefile
File metadata and controls
53 lines (43 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Development tasks. Requires: python3 (palette build), shellcheck and bats-core (lint/tests);
# zsh and fish for their completion tests (skipped without them).
SHELL_FILES := bin/iglass lib/*.sh install.sh tools/*.sh tests/*.bash tests/*.bats completions/iglass.bash
# Suites tagged macos need macOS tools (plutil, defaults); on Linux the rest run.
BATS_FILTER := $(if $(filter Linux,$(shell uname -s)),--filter-tags '!macos',)
.PHONY: all palettes themes lint test check-generated check
all: palettes themes
## Rebuild data/palette.json, docs/contrast-report.md and themes/*.itermcolors
palettes:
python3 tools/build_palettes.py
## Rebuild the prebuilt files for people who don't use the CLI: themes/iglass.json (iTerm2)
## themes/ghostty/ (Ghostty, real Liquid Glass for macOS 26+), themes/kitty/ and themes/warp/
themes:
bin/iglass export --terminal iterm2 > themes/iglass.json
rm -rf themes/ghostty
NO_COLOR=1 bin/iglass export --terminal ghostty --glass native --dir themes/ghostty >/dev/null
rm -rf themes/kitty
NO_COLOR=1 bin/iglass export --terminal kitty --dir themes/kitty >/dev/null
rm -rf themes/warp
NO_COLOR=1 IGLASS_PLATFORM=macos bin/iglass export --terminal warp --dir themes/warp >/dev/null
lint:
shellcheck $(SHELL_FILES)
test:
python3 -m unittest discover -s tests -p 'test_*.py'
bats $(BATS_FILTER) tests/
## Fail when generated files don't match their sources
check-generated:
python3 tools/build_palettes.py --check
bin/iglass export --terminal iterm2 | cmp -s - themes/iglass.json || \
(echo "themes/iglass.json is out of date: run make themes" >&2; exit 1)
rm -rf .check-ghostty && NO_COLOR=1 bin/iglass export --terminal ghostty --glass native --dir .check-ghostty >/dev/null
diff -r themes/ghostty .check-ghostty >/dev/null || \
(rm -rf .check-ghostty; echo "themes/ghostty is out of date: run make themes" >&2; exit 1)
rm -rf .check-ghostty
rm -rf .check-kitty && NO_COLOR=1 bin/iglass export --terminal kitty --dir .check-kitty >/dev/null
diff -r themes/kitty .check-kitty >/dev/null || \
(rm -rf .check-kitty; echo "themes/kitty is out of date: run make themes" >&2; exit 1)
rm -rf .check-kitty
rm -rf .check-warp && NO_COLOR=1 IGLASS_PLATFORM=macos bin/iglass export --terminal warp --dir .check-warp >/dev/null
diff -r themes/warp .check-warp >/dev/null || \
(rm -rf .check-warp; echo "themes/warp is out of date: run make themes" >&2; exit 1)
rm -rf .check-warp
check: lint check-generated test