Compare commits
1 Commits
87dc93513b
...
f6474315f8
| Author | SHA1 | Date | |
|---|---|---|---|
| f6474315f8 |
@@ -29,11 +29,18 @@ fn is_excluded_dir(path: &Path) -> bool {
|
||||
}
|
||||
|
||||
fn collect_source_files(path: &Path) -> status::Result<Vec<SourceFile>> {
|
||||
collect_source_files_with_exclusions(path, false)
|
||||
}
|
||||
|
||||
fn collect_source_files_with_exclusions(
|
||||
path: &Path,
|
||||
exclude_current_dir: bool,
|
||||
) -> status::Result<Vec<SourceFile>> {
|
||||
let metadata = std::fs::symlink_metadata(path)
|
||||
.with_context(|| format!("failed to read metadata for {}", path.display()))?;
|
||||
|
||||
if metadata.file_type().is_dir() {
|
||||
if is_excluded_dir(path) {
|
||||
if exclude_current_dir && is_excluded_dir(path) {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
|
||||
@@ -44,7 +51,7 @@ fn collect_source_files(path: &Path) -> status::Result<Vec<SourceFile>> {
|
||||
{
|
||||
let entry =
|
||||
entry.with_context(|| format!("failed to read entry in {}", path.display()))?;
|
||||
files.extend(collect_source_files(&entry.path())?);
|
||||
files.extend(collect_source_files_with_exclusions(&entry.path(), true)?);
|
||||
}
|
||||
|
||||
return Ok(files);
|
||||
|
||||
Reference in New Issue
Block a user