2020-05-27 19:47:48 +00:00
|
|
|
# watchexec
|
|
|
|
|
|
|
|
> Run arbitrary commands when files change.
|
|
|
|
> More information: <https://github.com/watchexec/watchexec>.
|
|
|
|
|
|
|
|
- Call `ls -la` when any file in the current directory changes:
|
|
|
|
|
2023-08-23 08:55:18 +02:00
|
|
|
`watchexec {{ls -la}}`
|
2020-05-27 19:47:48 +00:00
|
|
|
|
2023-08-23 08:55:18 +02:00
|
|
|
- Run `make` when any JavaScript, CSS and HTML file in the current directory changes:
|
2020-05-27 19:47:48 +00:00
|
|
|
|
|
|
|
`watchexec --exts {{js,css,html}} make`
|
|
|
|
|
2023-08-23 08:55:18 +02:00
|
|
|
- Run `make` when any file in the `lib` or `src` directory changes:
|
2020-05-27 19:47:48 +00:00
|
|
|
|
|
|
|
`watchexec --watch {{lib}} --watch {{src}} {{make}}`
|
|
|
|
|
2023-08-23 08:55:18 +02:00
|
|
|
- Call/restart `my_server` when any file in the current directory changes, sending `SIGKILL` to stop the child process:
|
2020-05-27 19:47:48 +00:00
|
|
|
|
2023-08-20 14:27:11 +00:00
|
|
|
`watchexec --restart --stop-signal {{SIGKILL}} {{my_server}}`
|