From 79b82efe8902cb1269372008afd5792afab37df7 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 22 Dec 2020 11:32:19 +0100 Subject: Fine-grained compilation when watching --- scripts/watch_content.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts/watch_content.sh') diff --git a/scripts/watch_content.sh b/scripts/watch_content.sh index d2578e1..38567dc 100755 --- a/scripts/watch_content.sh +++ b/scripts/watch_content.sh @@ -1,8 +1,12 @@ #!/bin/bash -inotifywait -m -e create -e close_write --format "%f" content \ +inotifywait -rme create,close_write,delete,move --format "%f" content \ | while read FILENAME do - printf "Change detected: %s\n" "$FILENAME" - scripts/build_content.sh + printf "Change detected: %s\n" "content/$FILENAME" + if [ -f "content/$FILENAME" ]; then + scripts/build_content.sh "content/$FILENAME" + else + scripts/build_content.sh "content/$FILENAME" "delete" + fi done -- cgit v1.2.3-70-g09d2