git ssb

0+

Grey the earthling / gkn.me.uk



Tree: 3fc42e2506afd1ca9d81b85bc123ead5ebcef8b7

Files: 3fc42e2506afd1ca9d81b85bc123ead5ebcef8b7 / Makefile

1450 bytesRaw
1.PHONY: lint clean check-publish publish serve
2
3output: $(shell find content static) .cache/generator .cache/fonts .cache/lint
4 python generator/generate.py
5 touch $@
6
7.cache/generator: $(shell find generator) .cache/deps
8 python -m black .
9 touch $@
10
11.cache/deps: Makefile
12 toolbox run pip install black
13 toolbox run pip install beautifulsoup4==4.9.3
14 toolbox run pip install marko==1.1.0
15 toolbox run pip install python-frontmatter==1.0.0
16 mkdir -p .cache
17 touch $@
18
19.cache/fonts: $(shell find ~/Software/src/iosevka/dist/*/woff2/) ~/Software/src/smol-emoji/SmolEmoji-Regular.otf
20 touch $@
21
22lint: .cache/lint
23
24.cache/lint: $(shell find static/style)
25 toolbox run npx -y prettier -w static/style/tarazed.css
26 touch $@
27
28clean: .cache/clean
29
30.cache/clean: $(shell find output/*)
31 rm -r output
32 touch $@
33
34check-publish:
35ifeq "${SSHUSER}" ""
36 @echo "SSHUSER is undefined"
37 @exit 1
38else ifeq "${SSHPASS}" ""
39 @echo "SSHPASS is undefined"
40 @exit 1
41else ifeq "${SSHDIR}" ""
42 @echo "SSHDIR is undefined"
43 @exit 1
44else ifeq "${SSHPORT}" ""
45 @echo "SSHPORT is undefined"
46 @exit 1
47else ifneq "$(shell git status --porcelain)" ""
48 @echo "Uncommitted changes:"
49 @git status --porcelain
50 @exit 1
51endif
52
53publish: clean check-publish .cache/publish
54
55.cache/publish: output
56 echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \
57 sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT}
58 touch $@
59
60serve: output
61 cd output && python -m http.server
62

Built with git-ssb-web