mirror of
https://github.com/nushell/nushell.git
synced 2025-04-01 11:46:20 +02:00
Fix expanding external args (#847)
This commit is contained in:
parent
f4c0538653
commit
1ca3e03578
@ -302,10 +302,17 @@ impl<'call> ExternalCommand<'call> {
|
|||||||
let mut process = std::process::Command::new(&new_head);
|
let mut process = std::process::Command::new(&new_head);
|
||||||
|
|
||||||
for arg in self.args.iter() {
|
for arg in self.args.iter() {
|
||||||
let arg = Spanned {
|
let mut arg = Spanned {
|
||||||
item: trim_enclosing_quotes(&arg.item),
|
item: trim_enclosing_quotes(&arg.item),
|
||||||
span: arg.span,
|
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);
|
let cwd = PathBuf::from(cwd);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user