Commit d60b6737ce74cea38d2cd1b8c0007e44cf6504e4
Check status first when publishing
Grey Nicholson committed on 10/1/2021, 6:32:36 PMParent: 27268b699a2fd33a120e3d133e0d862cfd4c8603
Files changed
Makefile | changed |
Makefile | |||
---|---|---|---|
@@ -1,5 +1,5 @@ | |||
1 | -.PHONY: publish lint serve | ||
1 … | +.PHONY: status publish lint serve | ||
2 | 2 … | ||
3 | 3 … | output: $(shell find content static) .cache/generator | |
4 | 4 … | python generator/generate.py | |
5 | 5 … | touch $@ | |
@@ -15,34 +15,34 @@ | |||
15 | 15 … | pip install python-frontmatter==1.0.0 | |
16 | 16 … | mkdir -p .cache | |
17 | 17 … | touch $@ | |
18 | 18 … | ||
19 | -publish: .cache/publish | ||
20 | - | ||
21 | -.cache/publish: output | ||
19 … | +status: | ||
22 | 20 … | ifeq "${SSHUSER}" "" | |
23 | 21 … | @echo "SSHUSER is undefined" | |
24 | - exit 1 | ||
22 … | + @exit 1 | ||
25 | 23 … | else ifeq "${SSHPASS}" "" | |
26 | 24 … | @echo "SSHPASS is undefined" | |
27 | - exit 1 | ||
25 … | + @exit 1 | ||
28 | 26 … | else ifeq "${SSHDIR}" "" | |
29 | 27 … | @echo "SSHDIR is undefined" | |
30 | - exit 1 | ||
28 … | + @exit 1 | ||
31 | 29 … | else ifeq "${SSHPORT}" "" | |
32 | 30 … | @echo "SSHPORT is undefined" | |
33 | - exit 1 | ||
31 … | + @exit 1 | ||
34 | 32 … | else ifneq "$(shell git status --porcelain)" "" | |
35 | 33 … | @echo "Uncommitted changes:" | |
36 | 34 … | @git status --porcelain | |
37 | - exit 1 | ||
38 | -else | ||
35 … | + @exit 1 | ||
36 … | +endif | ||
37 … | + | ||
38 … | +publish: status .cache/publish | ||
39 … | + | ||
40 … | +.cache/publish: output | ||
39 | 41 … | echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \ | |
40 | 42 … | sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT} | |
41 | 43 … | touch $@ | |
42 | -endif | ||
43 | 44 … | ||
44 | - | ||
45 | 45 … | lint: $(shell find static/style) | |
46 | 46 … | toolbox run npx prettier -w static/style/tarazed.css | |
47 | 47 … | ||
48 | 48 … | serve: output |
Built with git-ssb-web