$it: add conversion from Path for external commands (#1210)

* $it: add conversion from Path for external commands (#1203)

* Replace PathBuf::to_str with to_string_lossy
This commit is contained in:
Koenraad Verheyden 2020-01-13 17:41:18 +01:00 committed by Jonathan Turner
parent 65980c7beb
commit 2ab5803f00

View File

@ -88,6 +88,10 @@ async fn run_with_iterator_arg(
value: UntaggedValue::Primitive(Primitive::Line(s)), value: UntaggedValue::Primitive(Primitive::Line(s)),
.. ..
} => Ok(s.clone()), } => Ok(s.clone()),
Value {
value: UntaggedValue::Primitive(Primitive::Path(p)),
..
} => Ok(p.to_string_lossy().to_string()),
_ => { _ => {
let arg = args.iter().find(|arg| arg.contains("$it")); let arg = args.iter().find(|arg| arg.contains("$it"));
if let Some(arg) = arg { if let Some(arg) = arg {