mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:15:42 +02:00
Send only absolute paths to uu_cp (#11080)
# Description Fixes https://github.com/nushell/nushell/issues/10832 Replaces: https://github.com/nushell/nushell/pull/10843
This commit is contained in:
@ -201,6 +201,14 @@ impl Command for UCp {
|
||||
sources.append(&mut app_vals);
|
||||
}
|
||||
|
||||
// Make sure to send absolute paths to avoid uu_cp looking for cwd in std::env which is not
|
||||
// supported in Nushell
|
||||
for src in sources.iter_mut() {
|
||||
if !src.is_absolute() {
|
||||
*src = nu_path::expand_path_with(&src, &cwd);
|
||||
}
|
||||
}
|
||||
|
||||
let options = uu_cp::Options {
|
||||
overwrite,
|
||||
reflink_mode,
|
||||
|
@ -50,11 +50,11 @@ impl Command for UMkdir {
|
||||
call: &Call,
|
||||
_input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
let path = current_dir(engine_state, stack)?;
|
||||
let cwd = current_dir(engine_state, stack)?;
|
||||
let mut directories = call
|
||||
.rest::<String>(engine_state, stack, 0)?
|
||||
.into_iter()
|
||||
.map(|dir| path.join(dir))
|
||||
.map(|dir| nu_path::expand_path_with(dir, &cwd))
|
||||
.peekable();
|
||||
|
||||
let is_verbose = call.has_flag("verbose");
|
||||
|
Reference in New Issue
Block a user