Skip to content

Commit

Permalink
Check if watched file was recreated after remove
Browse files Browse the repository at this point in the history
  • Loading branch information
dxrcy committed Sep 17, 2024
1 parent 0d82fe9 commit c5d51c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ fn main() -> miette::Result<()> {
Flow::Continue
}
EventKind::Remove(_) => {
message(Red, "Error", "watched file was deleted. Exiting...");
std::process::exit(1);
if name.exists() {
Flow::Continue
} else {
message(Red, "Error", "watched file was deleted. Exiting...");
std::process::exit(1);
}
}
_ => Flow::Continue,
})
Expand Down

0 comments on commit c5d51c1

Please sign in to comment.