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

Proposal: let globs follow links #132

Merged
merged 2 commits into from
Oct 1, 2020

Conversation

mkantor
Copy link
Contributor

@mkantor mkantor commented Aug 15, 2020

This would let me be more creative with where I place my input files.

@@ -7,6 +7,7 @@ use crate::settings::Settings;
pub fn glob_exec<F: FnMut(&Path)>(base: &Path, pattern: &str, mut f: F) {
let walker = GlobWalkerBuilder::new(base, pattern)
.case_insensitive(true)
.follow_links(true)
.file_type(FileType::FILE)
Copy link
Contributor Author

@mkantor mkantor Aug 15, 2020

Choose a reason for hiding this comment

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

Tangentially, what's the reason for constraining globs to only match regular files?

I have a project where my inputs for snapshots are directories, not files, and it would be handy to be able to use the glob! macro (right now I loop through them myself).

@mitsuhiko mitsuhiko merged commit 659f1a3 into mitsuhiko:master Oct 1, 2020
@mitsuhiko
Copy link
Owner

This is a good chance, adding. The main reason to skip over folders was to avoid accidentally encountering stuff that should not be included if you directly open a file. But there are arguments to be made that it should also include directories.

@mkantor mkantor deleted the globs-follow-links branch October 3, 2020 17:16
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.

None yet

2 participants