watchexec
Run arbitrary commands when files change. More information: https://github.com/watchexec/watchexec.
- Call
ls -lawhen any file in the current directory changes:
watchexec -- {{ls -la}}
- Run
makewhen any JavaScript, CSS and HTML files in the current directory change:
watchexec --exts {{js,css,html}} make
- Run
makewhen any file in theliborsrcsubdirectories change:
watchexec --watch {{lib}} --watch {{src}} {{make}}
- Call/restart
my_serverwhen any file in the current directory change, sendingSIGKILLto stop the child process:
watchexec --restart --signal {{SIGKILL}} {{my_server}}