summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2024-08-21 19:29:30 +0900
committerhaturatu <taro@eyes4you.org>2024-08-21 19:29:30 +0900
commit4a974ae2ff5f41228c939efa5c79248e12e0f9db (patch)
treed164c7b8ad20afec4fa5a1bbfbddbd73320730e1
parentcee5424a49cb85961148d61ccad15c805762ed5d (diff)
fix output
-rw-r--r--lume-watcher6
1 files 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