Cross-platform way to run arbitrary commands when files change
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Chore: update deps Jan 30, 2019
.gitignore Big Bang 💥 Dec 27, 2018
Cargo.lock Chore: update deps Jan 30, 2019
Cargo.toml Switch to structopt crate, improve error handling Dec 31, 2018
PKGBUILD Add PKGBUILD Dec 27, 2018
README.md Update example in README.md Jan 31, 2019

README.md

Entr

Cross platform way to run arbitrary commands when files change.

Usage

echo "filenames" | entr command

Example:

touch /tmp/file.txt
find /tmp -type f -name "*.txt" | entr -p echo 'Captain! Look!'

# in another terminal...
echo "That's got to be the best pirate I've ever seen" >> /tmp/file.txt

For commands that uses builtins, pipes or output redirection that needs to run in a shell, there's a -s flag that uses the default system shell:

find /tmp -type f -name "*.txt" | entr -s "echo 'Captain! Look!' | rev"

It also watch changes recursively if a directory is provided!

echo "dir/to/watch" | entr -R echo 'Do something'

Compilation

cargo build --release

Arch Linux installation

makepkg -sif