peakroute 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-OWNUHDR5.js → chunk-ENHLKLCJ.js} +21 -7
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -544,13 +544,27 @@ function spawnCommand(commandArgs, options) {
|
|
|
544
544
|
const env = { ...options?.env ?? process.env, PATH: augmentedPath(options?.env) };
|
|
545
545
|
let child;
|
|
546
546
|
if (IS_WINDOWS) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
547
|
+
const isPowerShell = !!process.env.PSModulePath || process.env.TERM === "xterm-256color";
|
|
548
|
+
if (isPowerShell) {
|
|
549
|
+
const shellCmd = commandArgs.map((a) => {
|
|
550
|
+
if (/[\s"'()$;|&<>@`]/.test(a)) {
|
|
551
|
+
return `"${a.replace(/"/g, '`"')}"`;
|
|
552
|
+
}
|
|
553
|
+
return a;
|
|
554
|
+
}).join(" ");
|
|
555
|
+
child = spawn("powershell.exe", ["-Command", shellCmd + "; exit $LASTEXITCODE"], {
|
|
556
|
+
stdio: "inherit",
|
|
557
|
+
env,
|
|
558
|
+
windowsHide: true
|
|
559
|
+
});
|
|
560
|
+
} else {
|
|
561
|
+
child = spawn(commandArgs[0], commandArgs.slice(1), {
|
|
562
|
+
stdio: "inherit",
|
|
563
|
+
env,
|
|
564
|
+
shell: true,
|
|
565
|
+
windowsHide: true
|
|
566
|
+
});
|
|
567
|
+
}
|
|
554
568
|
} else {
|
|
555
569
|
const shellCmd = commandArgs.map(shellEscape).join(" ");
|
|
556
570
|
child = spawn("/bin/sh", ["-c", shellCmd], {
|
package/dist/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
spawnCommand,
|
|
25
25
|
waitForProxy,
|
|
26
26
|
writeTlsMarker
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ENHLKLCJ.js";
|
|
28
28
|
|
|
29
29
|
// src/cli.ts
|
|
30
30
|
import chalk from "chalk";
|
|
@@ -884,7 +884,7 @@ ${chalk.bold("Skip peakroute:")}
|
|
|
884
884
|
process.exit(0);
|
|
885
885
|
}
|
|
886
886
|
if (args[0] === "--version" || args[0] === "-v") {
|
|
887
|
-
console.log("0.5.
|
|
887
|
+
console.log("0.5.2");
|
|
888
888
|
process.exit(0);
|
|
889
889
|
}
|
|
890
890
|
if (args[0] === "trust") {
|
package/dist/index.js
CHANGED