Update WSL call to use bash instead of wsl command

This commit is contained in:
Federico Terzi 2020-06-14 18:01:35 +02:00
parent a7d10cbed7
commit b87e32e91d

View File

@ -34,6 +34,7 @@ pub enum Shell {
Cmd,
Powershell,
WSL,
WSL2,
Bash,
Sh,
}
@ -52,6 +53,11 @@ impl Shell {
command
},
Shell::WSL => {
let mut command = Command::new("bash");
command.args(&["-c", &cmd]);
command
},
Shell::WSL2 => {
let mut command = Command::new("wsl");
command.args(&["bash", "-c", &cmd]);
command
@ -79,6 +85,7 @@ impl Shell {
"cmd" => Some(Shell::Cmd),
"powershell" => Some(Shell::Powershell),
"wsl" => Some(Shell::WSL),
"wsl2" => Some(Shell::WSL2),
"bash" => Some(Shell::Bash),
"sh" => Some(Shell::Sh),
_ => None,