Make the path-separator check Windows-only

This commit is contained in:
David Peter 2021-08-08 12:02:57 +02:00 committed by David Peter
parent 515e0ee469
commit d9697d1486
1 changed files with 11 additions and 8 deletions

View File

@ -177,6 +177,8 @@ fn run() -> Result<ExitCode> {
.value_of("path-separator") .value_of("path-separator")
.map_or_else(filesystem::default_path_separator, |s| Some(s.to_owned())); .map_or_else(filesystem::default_path_separator, |s| Some(s.to_owned()));
#[cfg(windows)]
{
if let Some(ref sep) = path_separator { if let Some(ref sep) = path_separator {
if sep.len() > 1 { if sep.len() > 1 {
return Err(anyhow!( return Err(anyhow!(
@ -189,6 +191,7 @@ fn run() -> Result<ExitCode> {
)); ));
}; };
}; };
}
let ls_colors = if colored_output { let ls_colors = if colored_output {
Some(LsColors::from_env().unwrap_or_else(|| LsColors::from_string(DEFAULT_LS_COLORS))) Some(LsColors::from_env().unwrap_or_else(|| LsColors::from_string(DEFAULT_LS_COLORS)))