Entr: Rerun your build when files change
jvns.ca
jvns.ca
A proper build system should be able to be integrated with your editor or IDE, and whenever a save happens, a plugin for your editor/IDE, or a filesystem scan by the build system server, should activate a "quick build" using the list of changed files.
Of course, entr fills the niche where you want something to happen but don't want to go to the trouble of setting up a build system, so it had that going for it as well.
Disclaimer: I'm building such a build system. And now I wonder if I can design it such that it fulfills all of the roles entr does...
Entr is great because it does one thing super duper well. Been using it for years almost daily and never have any issues with it.
If you use Vim, however, its defaults can interfere with auto-build setups that depend on file watching: https://lee-phillips.org/badvim/
> ls *.clj | entr -rcs './problem01.clj < input01.txt'
The problem is that ls only returns the list of files that existed at the time it was run...
Keep in mind, this is a limitation of filesystem watchers, not entr specifically. It'd would have to do some juggling whenever a file was added.
entr is focused on doing what it does well, and I don't have a solution here. Just feels like there should be something to handle that use case.
does a similar thing.