4 ms·
I use `entr` all the time for feedback on testing and development. Have you found a way to get it to handle "new" files. It is very good at watching a group of
by stephen_cagle 4y ago
I use `entr` all the time for feedback on testing and development. Have you found a way to get it to handle "new" files. It is very good at watching a group of files, but my memory of it is that it barfs when you add/remove files?
> 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...
- leephillips 4y agoThere is an example of how to do that in the article, using `entr -d`.
- stephen_cagle 4y agoNot a huge deal, but this "exits" when you have a change to a directory. So you end up having to put the whole thing in a while loop. But then you can't capture SIGINT and now you have to kill the process. So you need to write something that can capture that and conditionally break the loop if it is such... 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.
- junon 4y agoUse -d and a while loop. 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.