$ brew install watchmanIn 4.9 version it comes with three commands:
- watchman
- watchman-wait
- watchman-make
The latter two are just utilities under the first one.
Lets focus on watchman itself and one of its outstanding feature called triggers. Actually, it is what it sounds to be - a mechanism that causes invoking given action on a given event happened (for example copying file to the remote server once it appear in certain folder)
Watchman Trigger Examples
Copying js files
watchman -- trigger $PWD cr '**/*.js' '**/*.css' '**/*.html' '**/*.php' -- sh push.shWhich basically causes all js, css, html and php files from the current folder are passed to push.sh script.
Push.sh script can look like this:
for i in $@ do docker cp $i centrum:/var/www/html/$i done