3 ms·
In my projects I use a script to watch for changes and recompile/restart with a loop such as: executable=/path/to/target while true; do make build
by joseph 5y ago
In my projects I use a script to watch for changes and recompile/restart with a loop such as:
executable=/path/to/target
while true; do
make build
if [ ${?} -eq 0 ]; then
${executable} run &
pid=${!}
fi
inotifywait -qq -e create -e modify -e delete --exclude '\.#.*' -r .
[ -n "${pid}" ] && kill ${pid}; pid=
done
This is simplified a bit, as the script usually contains some other things like starting and initializing the database.