maps.chandlerswift.com/Makefile
Chandler Swift 7957523c3c
Distribute data with layers instead of data/ dir
This was originally done to make the gitignoring easier, but ended up
being somewhat more complex when trying to include files, so they're
moving out closer to the point of use.
2023-07-25 19:14:05 -05:00

25 lines
789 B
Makefile

.PHONY: deploy
deploy: build
rsync --archive --verbose --delete dist/ zirconium.home.chandlerswift.com:/var/www/maps.chandlerswift.com/
.PHONY: clean
clean:
rm -r dist
.PHONY: build
build: # TODO: add get_data as a prereq
npm run build
# in theory I could use non-phony targets here, but then I'd have to be updating
# this file much more often. Maybe as things stabilize!
.PHONY: get_data
get_data:
@find ./ -name "get_data.*" \! -executable | grep . >/dev/null \
&& echo "Non-executable files found; consider running:" \
&& find ./ -name "get_data.*" \! -executable -exec echo " " chmod +x {} \; \
&& exit 1 \
|| true
@find ./ -name "get_data.*" -executable \
-exec sh -c 'cd $$(dirname {}) && echo processing {}; ./$$(basename {}) | sed --unbuffered "s/^/ /"' \;