@@ -29,6 +29,7 @@ import { tmpdir } from "node:os";
|
29 | 29 | import { basename, dirname, join, relative, resolve, win32 as pathWin32 } from "node:path"; |
30 | 30 | import { fileURLToPath, pathToFileURL } from "node:url"; |
31 | 31 | import { isLocalBuildMetadataDistPath } from "./lib/local-build-metadata-paths.mjs"; |
| 32 | +import { resolveWindowsTaskkillPath } from "./lib/windows-taskkill.mjs"; |
32 | 33 | import { buildCmdExeCommandLine } from "./windows-cmd-helpers.mjs"; |
33 | 34 | |
34 | 35 | const SCRIPT_PATH = fileURLToPath(import.meta.url); |
@@ -3623,11 +3624,15 @@ async function stopGateway(gateway) {
|
3623 | 3624 | return; |
3624 | 3625 | } |
3625 | 3626 | if (process.platform === "win32") { |
3626 | | -await runCommand("taskkill", ["/PID", String(gateway.child.pid), "/T", "/F"], { |
3627 | | -logPath: gateway.logPath, |
3628 | | -check: false, |
3629 | | -timeoutMs: 30_000, |
3630 | | -}); |
| 3627 | +await runCommand( |
| 3628 | +resolveWindowsTaskkillPath(), |
| 3629 | +["/PID", String(gateway.child.pid), "/T", "/F"], |
| 3630 | +{ |
| 3631 | +logPath: gateway.logPath, |
| 3632 | +check: false, |
| 3633 | +timeoutMs: 30_000, |
| 3634 | +}, |
| 3635 | +); |
3631 | 3636 | const exited = await waitForChildExit(gateway.child, 10_000); |
3632 | 3637 | if (!exited) { |
3633 | 3638 | gateway.child.stdout?.destroy(); |
@@ -3967,10 +3972,14 @@ async function runCommandInvocation(invocation, options) {
|
3967 | 3972 | const requestKill = () => { |
3968 | 3973 | if (process.platform === "win32" && child.pid) { |
3969 | 3974 | try { |
3970 | | -const killer = spawn("taskkill", ["/PID", String(child.pid), "/T", "/F"], { |
3971 | | -stdio: "ignore", |
3972 | | -windowsHide: true, |
3973 | | -}); |
| 3975 | +const killer = spawn( |
| 3976 | +resolveWindowsTaskkillPath(), |
| 3977 | +["/PID", String(child.pid), "/T", "/F"], |
| 3978 | +{ |
| 3979 | +stdio: "ignore", |
| 3980 | +windowsHide: true, |
| 3981 | +}, |
| 3982 | +); |
3974 | 3983 | killer.on("error", () => { |
3975 | 3984 | child.kill(); |
3976 | 3985 | }); |
|