Crates.io | caretaker |
lib.rs | caretaker |
version | 0.2.4 |
source | src |
created_at | 2020-01-15 14:51:41.122567 |
updated_at | 2022-06-17 16:23:33.567978 |
description | A simple, configurable filesystem watcher |
homepage | https://github.com/grego/caretaker |
repository | https://github.com/grego/caretaker |
max_upload_size | |
id | 198656 |
size | 26,575 |
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).
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
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.