TIL about entr, a command that lets you run arbitrary commands whenever files change.
I was working on a project where I had to run a build command whenever I saved a file. Once I installed
brew install entr), it took me about 5 seconds to figure out how to use it for this purpose.
find apple-news/ | entr -s 'npm run bespoke'
Any time a tile inside the directory
npm run bespoke gets run.
Looks like there are lots of other options for
entr but I’ll probably just stick to this pattern.