From 4a974ae2ff5f41228c939efa5c79248e12e0f9db Mon Sep 17 00:00:00 2001 From: haturatu Date: Wed, 21 Aug 2024 19:29:30 +0900 Subject: fix output --- lume-watcher | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lume-watcher b/lume-watcher index 3389292..cce486d 100644 --- a/lume-watcher +++ b/lume-watcher @@ -9,8 +9,9 @@ # Description: Watches the specified directory and triggers the Deno Lume task when changes are detected. ### END INIT INFO -WATCHED_DIR="/var/www/html/soulmining/src/" -COMMAND="/home/haturatu/.deno/bin/deno task lume --dest=site" +WATCHED_DIR="/var/www/html/soulmining/src" +OUTPUT_DIR="/var/www/html/soulmining" +COMMAND="cd $OUTPUT_DIR ; /home/haturatu/.deno/bin/deno task lume --dest=site" FLAG_FILE="/tmp/command_running.flag" COOLDOWN_TIME=60 # クールダウン時間(秒) LAST_RUN_FILE="/tmp/last_run.time" @@ -53,6 +54,7 @@ start() { elapsed_time=$((now - last_run_time)) if [ "$elapsed_time" -ge "$COOLDOWN_TIME" ]; then + sleep $COOLDOWN_TIME echo "Change detected, executing command..." touch "$FLAG_FILE" $COMMAND -- cgit v1.2.3