1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 17:02:08 +02:00
tldr/pages/common/watchexec.md
2023-08-23 12:25:18 +05:30

20 lines
643 B
Markdown

# 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:
`watchexec {{ls -la}}`
- Run `make` when any JavaScript, CSS and HTML file in the current directory changes:
`watchexec --exts {{js,css,html}} make`
- Run `make` when any file in the `lib` or `src` directory changes:
`watchexec --watch {{lib}} --watch {{src}} {{make}}`
- Call/restart `my_server` when any file in the current directory changes, sending `SIGKILL` to stop the child process:
`watchexec --restart --stop-signal {{SIGKILL}} {{my_server}}`