Watchexec is a utility that runs a command when files are modified.
Install watchexec on Mac with:
brew install watchexec
To send a SIGKILL signal to stop the child process before rerunning the command:
watchexec -n -s SIGKILL ${server-command}
To run make when any file in lib
or src
changes:
watchexec -w lib -w src make