How can I direct output of watchman trigger to terminal on OS X instead of watchman log file
Asked Answered
M

1

6

I am using the following line to watch a directory and run a script on changes:

watchman -- trigger my_directory runTransitionChecker '*' -- ruby ./my_script.rb

Everything works as I expect except all of the output of ruby ./my_script is directed to my

/usr/local/Cellar/watchman390/3.9.0/var/run/watchman/blahblah-state/log file.

From the docs and --help it seemed like maybe I was supposed to use the -f flag, but that doesn't seem to do it.

Mlawsky answered 27/1, 2016 at 6:49 Comment(0)
N
1

I'd recommend that you do this to get a much more current version of watchman:

brew update
brew install watchman

Then you can use https://facebook.github.io/watchman/docs/watchman-make

Nubilous answered 3/4, 2016 at 17:37 Comment(5)
This does not answer the question. What flag is needed to direct the output to the console instead of the log file? is it --logfile (-o) if yes what is the path to the console is it "/dev/stdout"?Ravelment
while you can redirect the server logs to stdout using --logfile=/dev/stdout, and that does happen to include the output from all triggers among everything else that the server outputs, the best way to spawn a command when files change and see the output is using watchman-make.Nubilous
Thanks, got it working. I had to jump through a bunch of hoops to install all the required software (pip, pywatchman and more). And install the latest watchman from source.Ravelment
The script I used was watchman-make -p 'app/**' 'config/**' --run "rails test". (With a few more folders in addition to app and config.)Ravelment
You should add yours as an answer @AryeEidelmanToluene

© 2022 - 2024 — McMap. All rights reserved.