Skip to content

Commit

Permalink
feat(updater): use try_exists instead of exists (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Apr 3, 2023
1 parent f1ff11d commit b939ef0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions updater/library/src/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,18 @@ fn get_base_path(original_lib_app_paths: &Vec<String>) -> anyhow::Result<PathBuf
// Iterate through the paths and find the first one that exists.
for path in original_lib_app_paths {
let path = PathBuf::from(path);
if path.exists() {
return Ok(path);
match path.try_exists() {
Ok(true) => {
return Ok(path);
}
Ok(false) => {
info!("File does not exist: {:?}", path);
continue;
}
Err(err) => {
info!("Failed to check for file: {:?}, err: {err}", path);
continue;
}
}
}
return Err(UpdateError::InvalidState("No base file found".to_string()).into());
Expand Down

0 comments on commit b939ef0

Please sign in to comment.