From 7d6d48f3f772aebaef047213f0bd74337a6f8a71 Mon Sep 17 00:00:00 2001 From: Firegem Date: Mon, 12 May 2025 04:44:06 -0400 Subject: [PATCH] Allow `path join` to read ByteStream input (#15128) (#15736) # 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`. --- crates/nu-command/src/path/join.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/nu-command/src/path/join.rs b/crates/nu-command/src/path/join.rs index fdf58e3afe..7244d21101 100644 --- a/crates/nu-command/src/path/join.rs +++ b/crates/nu-command/src/path/join.rs @@ -175,13 +175,11 @@ fn run(call: &Call, args: &Arguments, input: PipelineData) -> Result Ok(PipelineData::Value( + handle_value(stream.into_value()?, args, head), + metadata, + )), 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), - }), } }