mirror of
https://github.com/nushell/nushell.git
synced 2025-06-23 19:31:24 +02:00
# Description Fixes #15128. Allows `path join` to use ByteStream pipeline data to join on if it's coercible to string. Binary ByteStream input still results in an error. Tested with `^$nu.current-exe -c '$nu.config-path' | path join foo` and `^tar.exe -c assets/nu_logo.ico | path join foo` # User-Facing Changes If an external command returns a path, users would previously need to use `^show-path-cmd | collect | path join 'foo'`, now they can drop the intermediate `collect`.
This commit is contained in:
parent
6a8c183c1a
commit
7d6d48f3f7
@ -175,13 +175,11 @@ fn run(call: &Call, args: &Arguments, input: PipelineData) -> Result<PipelineDat
|
|||||||
handle_value(stream.into_value(), args, head),
|
handle_value(stream.into_value(), args, head),
|
||||||
metadata,
|
metadata,
|
||||||
)),
|
)),
|
||||||
|
PipelineData::ByteStream(stream, ..) => Ok(PipelineData::Value(
|
||||||
|
handle_value(stream.into_value()?, args, head),
|
||||||
|
metadata,
|
||||||
|
)),
|
||||||
PipelineData::Empty => Err(ShellError::PipelineEmpty { dst_span: head }),
|
PipelineData::Empty => Err(ShellError::PipelineEmpty { dst_span: head }),
|
||||||
_ => Err(ShellError::UnsupportedInput {
|
|
||||||
msg: "Input value cannot be joined".to_string(),
|
|
||||||
input: "value originates from here".into(),
|
|
||||||
msg_span: head,
|
|
||||||
input_span: input.span().unwrap_or(call.head),
|
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user