Expand description
Auto run command when some files changed.
fwatcher
also has a cli command.
§Usage
Dependencies in your project’s Cargo.toml
:
[dependencies]
glob = "0.2"
notify = "4.0"
fwatcher = "*"
§Example
extern crate glob;
extern crate fwatcher;
use fwatcher::Fwatcher;
use glob::Pattern;
use std::path::PathBuf;
use std::time::Duration;
fn main() {
let dirs =vec![PathBuf::from("src")];
let cmd = vec!["pytest".to_string()];
let mut fwatcher = Fwatcher::new(dirs, cmd);
fwatcher.pattern(Pattern::new("**/*.py").unwrap())
.exclude_pattern(Pattern::new("**/.git/**").unwrap())
.interval(Duration::new(1, 0))
.restart(false)
.run();
}
Modules§
- cli
- Install
Structs§
- Fwatcher
- a struct save
Fwatcher
state