From 041d642ed4afaed02c9a3b182883c47afb8aa9ab Mon Sep 17 00:00:00 2001 From: ysthakur <45539777+ysthakur@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:20:59 -0400 Subject: [PATCH] Expand reference file relative to cwd --- crates/nu-command/src/filesystem/utouch.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/nu-command/src/filesystem/utouch.rs b/crates/nu-command/src/filesystem/utouch.rs index b7e94ac5c5..3e5e33e5d3 100644 --- a/crates/nu-command/src/filesystem/utouch.rs +++ b/crates/nu-command/src/filesystem/utouch.rs @@ -74,7 +74,6 @@ impl Command for UTouch { "affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)", None ) - .rest("rest", SyntaxShape::Filepath, "Additional files to create.") .category(Category::FileSystem) } @@ -142,6 +141,7 @@ impl Command for UTouch { timestamp.item.timestamp_subsec_nanos(), )) } else if let Some(reference_file) = reference_file { + let reference_file = expand_path_with(reference_file, &cwd, true); Source::Reference(reference_file) } else { Source::Now @@ -189,7 +189,6 @@ impl Command for UTouch { let span = reference_span.expect("utouch should've been given a reference file"); if io_err.kind() == ErrorKind::NotFound { - // todo merge main into this to say which file not found ShellError::FileNotFound { span, file: reference_path.display().to_string(),