Neat tool called entr
TIL about a command line util called
brew install entr
sudo apt install entr
This will watch any filename you pipe into entr. Then it can run any script you pass it with
-s or just completely reload a process (ctrl - c and start again) using the
Perfect for scripting or spiking parsing weird payloads
ls *.rb | entr -r ruby main.rb
echo 'script.js' | entr -r node script.js
echo 'main.go' | entr -sr \
'docker stop $(docker ps -aq) && docker-compose up --build'
Repo with a bunch of langs
I made a repo so I could script in a bunch of different languages with watch scripts for each one!
Check it out: dev.random