mirror of
https://github.com/nushell/nushell
synced 2024-12-26 21:13:19 +00:00
Fix expanding external args (#847)
This commit is contained in:
parent
f4c0538653
commit
1ca3e03578
1 changed files with 8 additions and 1 deletions
|
@ -302,10 +302,17 @@ impl<'call> ExternalCommand<'call> {
|
|||
let mut process = std::process::Command::new(&new_head);
|
||||
|
||||
for arg in self.args.iter() {
|
||||
let arg = Spanned {
|
||||
let mut arg = Spanned {
|
||||
item: trim_enclosing_quotes(&arg.item),
|
||||
span: arg.span,
|
||||
};
|
||||
arg.item = if arg.item.starts_with('~') || arg.item.starts_with("..") {
|
||||
nu_path::expand_path_with(&arg.item, cwd)
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
} else {
|
||||
arg.item
|
||||
};
|
||||
|
||||
let cwd = PathBuf::from(cwd);
|
||||
|
||||
|
|
Loading…
Reference in a new issue