-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (73 loc) · 1.76 KB
/
Copy pathMakefile
File metadata and controls
82 lines (73 loc) · 1.76 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
ARGS = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
.PHONY: change
change: install
npx changie new
.PHONY: clean
clean:
rm -rf \
*.zip \
bin \
node_modules \
dev/public \
dev/resources \
dev/.hugo_build.lock \
test-results
.PHONY: dev
dev:
cd dev && hugo serve -DFO
.PHONY: changelog
changelog: install
npx changie batch $(call ARGS,defaultstring)
npx changie merge
.PHONY: install
install:
if [ ! -d ./node_modules/ ] || [ ! -x ./node_modules/.bin/playwright ]; then \
npm ci; \
fi
if ! command -v gotmplfmt > /dev/null 2>&1; then \
go install github.com/gohugoio/gotmplfmt@latest; \
fi
.PHONY: release
release: clean
@echo "Building release file: kana-hugo-theme.$(call ARGS,defaultstring).zip"
THEME_VERSION=$(call ARGS,defaultstring) && \
cd ../ && \
zip \
--verbose \
--recurse-paths \
--exclude="*.changes/*" \
--exclude="*.changie.yaml" \
--exclude="*.claude/*" \
--exclude="*.git/*" \
--exclude="*.github/*" \
--exclude="*.gitignore" \
--exclude="*.vscode/*" \
--exclude="*dev/*" \
--exclude="*e2e/*" \
--exclude="*Makefile" \
--exclude="*node_modules/*" \
--exclude="*package.json" \
--exclude="*package-lock.json" \
--exclude="*playwright.config.js" \
--exclude="*scripts/*" \
--exclude="*test-results/*" \
--exclude="*CHANGELOG.md" \
--exclude="*README.md" \
--exclude="*.zip" \
kana-hugo-theme/kana-hugo-theme.$(call ARGS,defaultstring).zip \
kana-hugo-theme/*
if [ ! -f ./kana-hugo-theme.$(call ARGS,defaultstring).zip ]; then \
echo "file not available"; \
exit 1; \
fi
.PHONY: screenshots
screenshots: install
npx playwright install chromium
node scripts/screenshots.mjs
.PHONY: test
test: install
npx playwright install
npm run e2e
.PHONY: lint
lint:
npm run lint