summaryrefslogtreecommitdiff
path: root/lume-watcher
diff options
context:
space:
mode:
Diffstat (limited to 'lume-watcher')
-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