mirror of
https://github.com/nushell/nushell.git
synced 2025-04-21 11:48:28 +02:00
Fix quoting on external Windows commands
This commit is contained in:
parent
dcb1d7167f
commit
e87ed76ef7
@ -239,10 +239,17 @@ impl ExternalCommand {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for arg in &self.args {
|
for arg in &self.args {
|
||||||
|
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());
|
process = process.arg(arg.item.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
let mut new_arg_string = self.name.to_string();
|
let mut new_arg_string = self.name.to_string();
|
||||||
|
Loading…
Reference in New Issue
Block a user