3 ms·
entr is is what I eventually settled on after years of searching the perfect utility to build/run tests after file changes. After using gulp, grunt, watching_te
by tony 10y ago
entr is is what I eventually settled on after years of searching the perfect utility to build/run tests after file changes. After using gulp, grunt, watching_testrunner (which I eventually inherited maintainership of), watchman, watchdog (https://github.com/gorakhargosh/watchdog https://github.com/gorakhargosh/watchdog), sniffer (https://github.com/jeffh/sniffer https://github.com/jeffh/sniffer)
entr is cross-platform on OS X, linux and BSD.
watching_testrunner has no BSD support
watchman is way too big and not domain specific enough to my needs
sniffer worked quite well but it required having a scent.py file everywhere
entr keeps it all in a neat, unix like package you can pipe files to.
I keep some example usage in my book, The Tao of tmux at https://leanpub.com/the-tao-of-tmux/read#leanpub-auto-file-watching https://leanpub.com/the-tao-of-tmux/read#leanpub-auto-file-w.... In this section I demonstrate my workflow with entr(1) in a Makefile. The code I use in the example should work across OS X / BSD / Linux (note the utilities like find(1) may behave a bit differently across unix-like systems).
I use the Makefile w/ entr(1) in development on my projects like tmuxp at https://github.com/tony/tmuxp/blob/master/Makefile https://github.com/tony/tmuxp/blob/master/Makefile. tmuxp is BSD-licensed so you're free to work off that if you'd like to try it on your own project.