#fsevents #notify #inotify #watcher

app caretaker

A simple, configurable filesystem watcher

10 releases

0.2.4 Jun 17, 2022
0.2.3 Jun 10, 2022
0.2.2 Sep 5, 2021
0.2.1 Mar 13, 2021
0.1.2 Jan 15, 2020

#322 in Command line utilities

Download history 11/week @ 2022-04-24 17/week @ 2022-05-01 51/week @ 2022-05-08 140/week @ 2022-05-15 34/week @ 2022-05-22 60/week @ 2022-05-29 64/week @ 2022-06-05 28/week @ 2022-06-12 18/week @ 2022-06-19 4/week @ 2022-06-26 25/week @ 2022-07-03 21/week @ 2022-07-10 12/week @ 2022-07-17 23/week @ 2022-07-24 14/week @ 2022-07-31 5/week @ 2022-08-07

54 downloads per month

MIT license

12KB
189 lines

caretaker

Build status Crates.io status Docs

A simple tool that loads a list of paths to watch from a TOML file.

[[watch]]
name = "print hello"
path = "src"
command = "echo $EVENT_PATH"

[[watch]]
name = "compile sass"
path = "sass/*.sass"
command = "sassc -t compressed sass/style.scss static/style.css"

On a change in the path, it executes the command. Directories are watched recursively. Paths can also be specified with globs. Any shell command can be used, along with pipes and so on. By default, the shell specified in the $SHELL environment variable is used to parse and execute the command. Otherwise, on Unix system, it invokes the default Bourne shell (sh command), on windows cmd.exe. Additionally, each command gets the $EVENT_PATH environment variable, containing the path that changed.

Using notify crate, which provides efficient event handling support for the most operating systems (apart from BSD).

Installing

Currently, Caretaker is available on AUR. You can install it with some AUR helper, like yay -S caretaker-bin.

If you have Rust toolchain installed, you can install it with Cargo:

cargo install caretaker

Running

Initialising with a dummy .watch.toml file:

caretaker init

Watching:

caretaker

You can also pass another file to load the config from via the -w option.

License

MIT

Dependencies

~2.9–8.5MB
~149K SLoC