Skip to content

Commit

Permalink
Warn if file !is_dir() and !is_file()
Browse files Browse the repository at this point in the history
  • Loading branch information
ErinvanderVeen committed Aug 29, 2023
1 parent 2401de2 commit c62bf1f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion topiary-cli/src/cli.rs
Expand Up @@ -161,8 +161,14 @@ fn traverse_fs(files: &mut Vec<PathBuf>) -> CLIResult<()> {
let mut subfiles = file.read_dir()?.flatten().map(|f| f.path()).collect();
traverse_fs(&mut subfiles)?;
expanded.append(&mut subfiles);
} else {
} else if file.is_file() {
expanded.push(file.to_path_buf());
} else {
// Warn but skip over files we don't recognise
log::warn!(
"Encountered file was not a directory or file, or the relevant information could not be retrieved when expanding input files: {}",
file.as_path().to_string_lossy()
);
}
}

Expand Down

0 comments on commit c62bf1f

Please sign in to comment.