-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(updater): use try_exists
instead of exists
#218
Conversation
try_exists
instead of exists
updater/library/src/updater.rs
Outdated
@@ -172,7 +172,7 @@ 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() { | |||
if path.try_exists()? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the behavior of the method so that if there is an earlier path with permissions errors we will now error out of get_base_path, rather than previously we would have returned a valid later path.
Is that what you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good point I'll adjust the behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eseidel I adjusted the behavior lmk what you think, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, feel free to land. You just might want to document the behavior change.
Description
Type of Change