feat: ignore .git

This commit is contained in:
2021-08-29 23:52:43 +08:00
parent 02be0ceaf5
commit 73453a3cee

View File

@@ -35,10 +35,12 @@ fn main() {
loop {
match rx.recv() {
Ok(RawEvent { path: Some(path), op: Ok(op), cookie }) => {
success!("Success: {:?} {:?} ({:?})", op, path, cookie);
match rust_util::util_cmd::run_command_and_wait(&mut Command::new(action)) {
Ok(exit_status) => success!("Run action success: {}", exit_status),
Err(e) => failure!("Run action: {}, failed: {}", action, e),
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)) {
Ok(exit_status) => success!("Run action success: {}", exit_status),
Err(e) => failure!("Run action: {}, failed: {}", action, e),
}
}
}
Ok(event) => information!("Broken event: {:?}", event),