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 thelib
orsrc
directory changes:
watchexec --watch {{lib}} --watch {{src}} {{make}}
-
Call/restart
my_server
when any file in the current directory changes, sendingSIGKILL
to stop the child process:
watchexec --restart --stop-signal {{SIGKILL}} {{my_server}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.