From 60af819160b0f87be924be943a1ea66415576593 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 7 May 2020 12:08:17 -0700 Subject: [PATCH] Add a script to watch for changes and rebuild --- Makefile | 5 ++++- bin/watch | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 bin/watch diff --git a/Makefile b/Makefile index 9f3d4c8..2bafaa4 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/bin/watch b/bin/watch new file mode 100755 index 0000000..865266f --- /dev/null +++ b/bin/watch @@ -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