Allow for missing directories

This commit is contained in:
DJRHails 2020-05-13 12:26:47 +01:00 committed by David Peter
parent ca2ef7ba82
commit c5a311d3cc

View file

@ -22,6 +22,7 @@ use globset::GlobBuilder;
use lscolors::LsColors;
use regex::bytes::{RegexBuilder, RegexSetBuilder};
use crate::error::print_error;
use crate::exec::CommandTemplate;
use crate::exit_codes::ExitCode;
use crate::filetypes::FileTypes;
@ -90,7 +91,13 @@ fn run() -> Result<ExitCode> {
))
}
})
.collect::<Result<Vec<_>>>()?,
.inspect(|res| {
if let Err(e) = res {
print_error(format!("{}", e))
}
})
.filter_map(Result::ok)
.collect::<Vec<_>>(),
None => vec![current_directory.to_path_buf()],
};