修复 Windows 下 Bash 脚本执行失败的问题

This commit is contained in:
fofolee 2025-01-25 08:19:23 +08:00
parent 4595ea8ef0
commit 680360ef2c

View File

@ -230,7 +230,7 @@ const buildCommandLine = (bin, argv, script, scptarg) => {
if (utools.isWindows() && bin === "bash") {
const wslPath = script.replace(/\\/g, "/").replace(/C:/i, "/mnt/c");
return `${bin} ${argv} "${wslPath}" ${scptarg}`;
return `wsl -e ${bin} ${argv} "${wslPath}" ${scptarg}`;
}
return `${bin} ${argv} "${script}" ${scptarg}`;