peakroute 0.5.5 → 0.5.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +6 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  import chalk from "chalk";
31
31
  import * as fs2 from "fs";
32
32
  import * as path2 from "path";
33
- import { spawn, spawnSync, execSync } from "child_process";
33
+ import { spawn, spawnSync } from "child_process";
34
34
 
35
35
  // src/certs.ts
36
36
  import * as fs from "fs";
@@ -437,10 +437,10 @@ var EXIT_TIMEOUT_MS = 2e3;
437
437
  var SUDO_SPAWN_TIMEOUT_MS = 3e4;
438
438
  function killProcess(pid, force = false) {
439
439
  if (IS_WINDOWS) {
440
- const args = force ? ["/F", "/T", "/PID", pid.toString()] : ["/T", "/PID", pid.toString()];
441
- try {
442
- execSync(`taskkill ${args.join(" ")}`, { windowsHide: true });
443
- } catch {
440
+ const args = ["/F", "/T", "/PID", pid.toString()];
441
+ const result = spawnSync("taskkill", args, { windowsHide: true, stdio: "pipe" });
442
+ if (result.status !== 0 && result.status !== 128) {
443
+ throw new Error(`taskkill failed with exit code ${result.status}`);
444
444
  }
445
445
  } else {
446
446
  try {
@@ -898,7 +898,7 @@ ${chalk.bold("Skip peakroute:")}
898
898
  process.exit(0);
899
899
  }
900
900
  if (args[0] === "--version" || args[0] === "-v") {
901
- console.log("0.5.5");
901
+ console.log("0.5.7");
902
902
  process.exit(0);
903
903
  }
904
904
  if (args[0] === "trust") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peakroute",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
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",