Improve external output in subexprs (#294)

This commit is contained in:
JT
2021-11-06 18:50:33 +13:00
committed by GitHub
parent c7d159a0f3
commit 02b8027749
50 changed files with 320 additions and 136 deletions

View File

@ -46,6 +46,6 @@ impl Command for LetEnv {
//println!("Adding: {:?} to {}", rhs, var_id);
stack.add_env_var(env_var, rhs);
Ok(PipelineData::new())
Ok(PipelineData::new(call.head))
}
}

View File

@ -91,7 +91,11 @@ impl TryFrom<&Value> for EnvVar {
Ok(EnvVar::Proper(s))
}
} else {
Err(ShellError::CantConvert("string".into(), value.span()?))
Err(ShellError::CantConvert(
"string".into(),
value.get_type().to_string(),
value.span()?,
))
}
}
}
@ -123,9 +127,10 @@ fn with_env(
env.insert(k.to_string(), v.try_into()?);
}
}
_ => {
x => {
return Err(ShellError::CantConvert(
"string list or single row".into(),
x.get_type().to_string(),
call.positional[1].span,
));
}
@ -145,9 +150,10 @@ fn with_env(
env.insert(k.clone(), v.try_into()?);
}
}
_ => {
x => {
return Err(ShellError::CantConvert(
"string list or single row".into(),
x.get_type().to_string(),
call.positional[1].span,
));
}