mirror of
https://github.com/nushell/nushell
synced 2025-01-15 14:44:14 +00:00
Merge pull request #241 from nushell/windows_quotes
Fix quoting on external Windows commands
This commit is contained in:
commit
65ae811e02
1 changed files with 8 additions and 1 deletions
|
@ -239,7 +239,14 @@ impl ExternalCommand {
|
|||
}
|
||||
} else {
|
||||
for arg in &self.args {
|
||||
process = process.arg(arg.item.clone());
|
||||
let arg_chars: Vec<_> = arg.chars().collect();
|
||||
if arg_chars.len() > 1 && arg_chars[0] == '"' && arg_chars[arg_chars.len() - 1] == '"' {
|
||||
// quoted string
|
||||
let new_arg: String = arg_chars[1..arg_chars.len() - 1].iter().collect();
|
||||
process = process.arg(new_arg);
|
||||
} else {
|
||||
process = process.arg(arg.item.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue