940 B
940 B
watchexec
Run arbitrary commands when files change. More information: https://manned.org/watchexec.
- Call
ls -lawhen any file in the current directory changes:
watchexec {{ls -la}}
- Run
makewhen any JavaScript, CSS and HTML file in the current directory changes:
watchexec {{[-e|--exts]}} {{js,css,html}} make
- Run
makewhen any file in theliborsrcdirectory changes:
watchexec {{[-w|--watch]}} {{lib}} {{[-w|--watch]}} {{src}} {{make}}
- Call/restart
my_serverwhen any file in the current directory changes, sendingSIGKILLto stop the child process:
watchexec {{[-r|--restart]}} --stop-signal {{SIGKILL}} {{my_server}}
- Restart the execution of a command when any Java source file in the current directory changes, sending
SIGKILLand only checking for updates everynms:
watchexec {{[-r|--restart]}} --stop-signal {{SIGKILL}} --poll {{10000}} {{[-e|--exts]}} {{java}} {{command}}