fswatcher
is a simple CLI tool to monitor file changes and execute a command when modifications are detected. It is built with Rust and utilizes the notify
crate for efficient filesystem event watching.
You can install fswatcher
using Cargo:
cargo install fswatcher
Run fswatcher
by specifying a file to watch and a command to execute when the file changes:
fswatcher <file> <command>
fswatcher config.yaml 'echo "Config changed!"'
This will monitor config.yaml
and print "Config changed!" whenever the file is modified.
- Watches a specified file for changes
- Executes a command automatically upon file modification
- Uses a lock mechanism to prevent same command duplicate execution
Clone the repository and build locally:
git clone https://github.com/jmarcelomb/fswatcher.git
cd fswatcher
cargo build --release
Run the tool with:
cargo run -- <file> <command>
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
Created by Marcelo Borges.