feat: ignore .git
This commit is contained in:
@@ -35,12 +35,14 @@ fn main() {
|
|||||||
loop {
|
loop {
|
||||||
match rx.recv() {
|
match rx.recv() {
|
||||||
Ok(RawEvent { path: Some(path), op: Ok(op), cookie }) => {
|
Ok(RawEvent { path: Some(path), op: Ok(op), cookie }) => {
|
||||||
success!("Success: {:?} {:?} ({:?})", op, path, cookie);
|
success!("Change: {:?} {:?} ({:?})", op, path, cookie);
|
||||||
|
if path.to_str().map(|s| !s.contains("/.git/")).unwrap_or(false) {
|
||||||
match rust_util::util_cmd::run_command_and_wait(&mut Command::new(action)) {
|
match rust_util::util_cmd::run_command_and_wait(&mut Command::new(action)) {
|
||||||
Ok(exit_status) => success!("Run action success: {}", exit_status),
|
Ok(exit_status) => success!("Run action success: {}", exit_status),
|
||||||
Err(e) => failure!("Run action: {}, failed: {}", action, e),
|
Err(e) => failure!("Run action: {}, failed: {}", action, e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(event) => information!("Broken event: {:?}", event),
|
Ok(event) => information!("Broken event: {:?}", event),
|
||||||
Err(e) => failure!("Watch error: {:?}", e),
|
Err(e) => failure!("Watch error: {:?}", e),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user