Skip to content

Commit

Permalink
chore: log notify errors if any
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulrahman1s committed Sep 2, 2022
1 parent 48800cc commit 60ea826
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lazy_static! {
.get_string("main.path")
.expect("Missing main.path env")
.parse()
.unwrap();
.expect("Invalid path string");
}

fn main() -> Result<()> {
Expand Down Expand Up @@ -57,11 +57,21 @@ fn main() -> Result<()> {

let mut changes = HashSet::<PathBuf>::new();

while let Ok(Ok(event)) = rx.recv() {
while let Ok(event) = rx.recv() {
let event = match event {
Ok(e) => e,
Err(err) => {
println!("Notify Error: {:?}", err);
continue;
}
};

if *syncing.lock().unwrap() {
continue;
}

println!("{:?}", event);

match event.kind {
EventKind::Create(CreateKind::File) => {
spinner("Saveing file...", "File saved", || {
Expand Down

0 comments on commit 60ea826

Please sign in to comment.