Run a specified command when any files in the target directory change.
$ npm install -g watch-exec
$ watch-exec -c [command] -w [path]
To use the
--notify flag for desktop notifications when the command completes or fails, you will need to have Growl notifications available to NodeJS.
- Mac OS X (Darwin):
brew install terminal-notifier
- Ubuntu (Linux):
sudo apt-get install libnotify-bin
If these instructions are not working correctly, check the installation steps for node-growl, which is used internally by watch-exec.
Thanks to @naholyr for adding support for notifications!