-
Notifications
You must be signed in to change notification settings - Fork 12
/
makefile
24 lines (16 loc) · 978 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.PHONY: all setup clean build upload serve permissions
.SILENT:
XOPP = $(shell find _includes/ -type f -name '*.xopp')
SVG = $(patsubst %.xopp, %.svg, $(XOPP))
all: build upload
xopp: $(SVG);
build: permissions $(SVG); ! ps -aux | grep "ruby.*jekyll" | grep -v grep -q && bundle exec jekyll build --trace || (echo "ERROR: Jekyll seems to be running already." && exit 1)
serve: permissions $(SVG); ! ps -aux | grep "ruby.*jekyll" | grep -v grep -q && bundle exec jekyll serve --trace --drafts --future --config _config.yml,_config-local.yml || (echo "ERROR: Jekyll seems to be running already." && exit 1)
upload: check
cd _site && git add . && git commit -m "automated commit" && git push -f
check:
! grep -R "localhost:4000" _site/**/*.html && echo " Check passed: No 'localhost:4000' found." || (echo "ERROR: Found 'localhost:4000' in HTML files, not uploading!" && exit 1)
clean:
bundle exec jekyll clean --trace
%.svg: %.xopp
_plugins/xopp_to_svg.py -f $^