Compare commits

..

1 Commits

Author SHA1 Message Date
f6474315f8 feat(xatu): set CLI exit statuses 2026-09-19 17:05:31 -04:00

View File

@@ -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);