News for hackers. Stuff that matters.
Re:A quick review of file watchers by fitsumbelay on Wednesday February 12, 2025 @05:28AM (#43023912)
`entr` is the homie
Re:A quick review of file watchers by kragen on Wednesday February 12, 2025 @06:05AM (#43024134)
What have you used it for? From Anarcat's notes, it sounds like it isn't very generally applicable.
Re:A quick review of file watchers by ndr on Wednesday February 12, 2025 @06:36AM (#43024319)
It's great for running unit tests on save, or hacking on python script and re-execute them when you need.

I often use something like this when iterating over stuff. This is a quick hack to list files I touched and differ from main.

    git diff main --name-only --relative | entr -r -c my-command
This of course needs to be killed and re-run if you want to pick up new files
Re:A quick review of file watchers by kragen on Wednesday February 12, 2025 @06:53AM (#43024421)
That's a great tip!
Re:A quick review of file watchers by simonmic on Thursday February 13, 2025 @02:30PM (#43040213)
It's great, but I switched to watchexec for its easier CLI. (But mac users, watch out for https://github.com/watchexec/watchexec/issues/864, hopefully fixed soon.)