From d3be192a3b07d108f5ffc9e10ca7a660d8677c52 Mon Sep 17 00:00:00 2001 From: bytedream Date: Sat, 5 Feb 2022 15:10:26 +0100 Subject: [PATCH] Added timeout of 5 since latest file change --- watch.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/watch.sh b/watch.sh index c736bb8..4d53206 100644 --- a/watch.sh +++ b/watch.sh @@ -30,6 +30,16 @@ stop() { kill $(pidof TheAdversary) } +process() { + sleep 5 + + cp -rf frontend/ backend/ out/ + build + echo "Restarting" + stop + start & +} + main() { init cp -rf frontend/ backend/ out/ @@ -39,10 +49,10 @@ main() { fi while inotifywait -r -e modify frontend/ backend/; do - cp -rf frontend/ backend/ out/ - build - stop - start & + if [ -d /proc/$! ]; then + kill $! + fi + process & done }