eradman/entr

Add option for showing which file that triggerered the util

hartmark opened this issue · 3 comments

I found this nice tool and it works perfectly for my use-case.

Only thing that would have been nice is to get a printout of what file was the reason for it to trigger.

There is a variable you can set to get debug output. I extended it to also print file mode and file name in commit 4482030

$ export EV_TRACE=1

$ ag -l | entr -p echo /_
open_max: 16384
0/1: fflags: 0x8 r 100644 posts/tdd-in-c.haml

This also might prove useful: the -s flag sets the first argument to the "leading edge" or first file that appears to have changed:

$ ag -l | entr -ps 'echo $0 changed'

(This method is not accurate unless you're only monitoring one file)

Nice, it works perfectly.

My use-case was to be able to work around the broken file watcher for dotnet, so I just wanted to have some printout which file has been modified when I run this command:
find . -name '*.cs*' | egrep -v '^./obj' | EV_TRACE=1 entr -r dotnet run

I've also created a aur-package for easier install on arch.
https://aur.archlinux.org/packages/entr-git/