Skip to content
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

fix: don't panic when search_dir.path doesn't exist #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ohlus
Copy link

@ohlus ohlus commented May 9, 2024

If paths processed by search_dirs() don't exist or shellexpand on them fails, they are ignored instead of a panic.

I'm just learning rust, so I'm not sure if this is the right way to do it, but it's working for me.

Fixes #100

src/configs.rs Outdated Show resolved Hide resolved
src/configs.rs Outdated Show resolved Hide resolved
@mattgallagher92
Copy link

@petersimonsson is this ready to go? I'd love this behaviour because I'm using the same config across two machines and sometimes the directories on one don't exist the other.

Copy link
Contributor

@junglerobba junglerobba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a rebase, but otherwise this looks fine to me

}));
}
}

if search_dirs.is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a usability thing, but maybe a warning here still makes sense if none of the configured search dirs actually exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when search_dirs.path doesn't exist
4 participants