fix(wsl): wsl should prefer the defined shell instead of powershell.exe (#1766)

This commit is contained in:
K
2025-03-30 05:54:40 +01:00
committed by GitHub
parent 484e473a5a
commit 25b3956b80

View File

@@ -96,9 +96,6 @@ local function get_cmd_for_shell(input_cmd, shell_cmd)
-- powershell then we can just run the cmd
if shell:match("powershell") or shell:match("pwsh") then
cmd = input_cmd
elseif fn.has("wsl") > 0 then
-- wsl: powershell.exe -Command 'command "/path"'
cmd = "powershell.exe -NoProfile -Command '" .. input_cmd:gsub("'", '"') .. "'"
elseif fn.has("win32") > 0 then
cmd = 'powershell.exe -NoProfile -Command "' .. input_cmd:gsub('"', "'") .. '"'
else