git ssb

0+

Grey the earthling / gkn.me.uk



Commit d60b6737ce74cea38d2cd1b8c0007e44cf6504e4

Check status first when publishing

Grey Nicholson committed on 10/1/2021, 6:32:36 PM
Parent: 27268b699a2fd33a120e3d133e0d862cfd4c8603

Files changed

Makefilechanged
MakefileView
@@ -1,5 +1,5 @@
1-.PHONY: publish lint serve
1 +.PHONY: status publish lint serve
22
33 output: $(shell find content static) .cache/generator
44 python generator/generate.py
55 touch $@
@@ -15,34 +15,34 @@
1515 pip install python-frontmatter==1.0.0
1616 mkdir -p .cache
1717 touch $@
1818
19-publish: .cache/publish
20-
21-.cache/publish: output
19 +status:
2220 ifeq "${SSHUSER}" ""
2321 @echo "SSHUSER is undefined"
24- exit 1
22 + @exit 1
2523 else ifeq "${SSHPASS}" ""
2624 @echo "SSHPASS is undefined"
27- exit 1
25 + @exit 1
2826 else ifeq "${SSHDIR}" ""
2927 @echo "SSHDIR is undefined"
30- exit 1
28 + @exit 1
3129 else ifeq "${SSHPORT}" ""
3230 @echo "SSHPORT is undefined"
33- exit 1
31 + @exit 1
3432 else ifneq "$(shell git status --porcelain)" ""
3533 @echo "Uncommitted changes:"
3634 @git status --porcelain
37- exit 1
38-else
35 + @exit 1
36 +endif
37 +
38 +publish: status .cache/publish
39 +
40 +.cache/publish: output
3941 echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \
4042 sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT}
4143 touch $@
42-endif
4344
44-
4545 lint: $(shell find static/style)
4646 toolbox run npx prettier -w static/style/tarazed.css
4747
4848 serve: output

Built with git-ssb-web