Skip to content

Commit 78488d6

Browse files
authored
Use process.execve where it is supported (#3241)
1 parent 04af079 commit 78488d6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • _packages/native-preview/bin

_packages/native-preview/bin/tsgo.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ import { execFileSync } from "node:child_process";
55

66
const exe = getExePath();
77

8+
if (typeof process.execve === "function") {
9+
// > v22.15.0
10+
try {
11+
process.execve(exe, [exe, ...process.argv.slice(2)]);
12+
}
13+
catch {
14+
// not available on windows, ignore the error and fallback
15+
}
16+
}
17+
818
try {
919
execFileSync(exe, process.argv.slice(2), { stdio: "inherit" });
1020
}

0 commit comments

Comments
 (0)