mirror of
https://github.com/Hopiu/lychee.git
synced 2026-04-02 04:30:26 +00:00
Filter out directories with suffixes that look like extensions
Directories can still have a suffix which looks like a file extension like `foo.html`. This can lead to unexpected behavior with glob patterns like `**/*.html`. Therefore filter these out. https://github.com/lycheeverse/lychee/pull/262#issuecomment-91322681
This commit is contained in:
parent
f47282093a
commit
00ddb6dfc8
1 changed files with 8 additions and 0 deletions
|
|
@ -161,6 +161,14 @@ impl Input {
|
|||
for entry in glob_with(&glob_expanded, match_opts)? {
|
||||
match entry {
|
||||
Ok(path) => {
|
||||
if path.is_dir() {
|
||||
// Directories can still have a suffix which looks like
|
||||
// a file extension like `foo.html`. This can lead to
|
||||
// unexpected behavior with glob patterns like
|
||||
// `**/*.html`. Therefore filter these out.
|
||||
// https://github.com/lycheeverse/lychee/pull/262#issuecomment-913226819
|
||||
continue;
|
||||
}
|
||||
let content = Self::path_content(&path)?;
|
||||
contents.push(content);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue