[Vuejs]-Inotifywait executes bash script first time only

0👍

The --daemon option makes inotifywait put itself into the background immediately. the main process exits immediately, and then $build_script is executed.

You should monitor the output file and run the build script every time a line is written:

inotifywait --monitor --daemon --outfile "$outfile" --event modify,create,delete --recursive "$watch"

while read -r line; do
    "$build_script"
done < "$outfile"

Leave a comment