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.
@@ -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
- child = spawn(commandArgs[0], commandArgs.slice(1), {
548
- stdio: "inherit",
549
- env,
550
- shell: true,
551
- windowsHide: true
552
- // Esconde janela do console
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-OWNUHDR5.js";
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.0");
887
+ console.log("0.5.2");
888
888
  process.exit(0);
889
889
  }
890
890
  if (args[0] === "trust") {
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  formatUrl,
15
15
  isErrnoException,
16
16
  parseHostname
17
- } from "./chunk-OWNUHDR5.js";
17
+ } from "./chunk-ENHLKLCJ.js";
18
18
  export {
19
19
  DIR_MODE,
20
20
  FILE_MODE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peakroute",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Replace port numbers with stable, named .localhost URLs. For humans and agents. (Formerly portless)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",