mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 17:35:10 +02:00
Improve external output in subexprs (#294)
This commit is contained in:
2
crates/nu-command/src/env/let_env.rs
vendored
2
crates/nu-command/src/env/let_env.rs
vendored
@ -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))
|
||||
}
|
||||
}
|
||||
|
12
crates/nu-command/src/env/with_env.rs
vendored
12
crates/nu-command/src/env/with_env.rs
vendored
@ -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,
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user