Add a script to watch for changes and rebuild

This commit is contained in:
Sami Samhuri 2020-05-07 12:08:17 -07:00
parent 9bebea8225
commit 60af819160
2 changed files with 14 additions and 1 deletions

View file

@ -47,4 +47,7 @@ serve:
@echo
cd www && python -m SimpleHTTPServer
.PHONY: debug ocean beta release publish publish_beta clean clean_blog clean_swift serve
watch:
bin/watch
.PHONY: debug ocean beta release publish publish_beta clean clean_blog clean_swift serve watch

10
bin/watch Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
BLOG_TARGET=${BLOG_TARGET:-ocean}
while true; do
inotifywait -e modify,create,delete,move -r drafts -r posts
echo "changed at $(date)"
sleep 5
make "$TARGET"
done