@yishiguji/tokenarena 0.16.4 → 0.16.6

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/index.js CHANGED
@@ -8029,7 +8029,7 @@ View your dashboard at: ${apiUrl}/usage`);
8029
8029
  }
8030
8030
 
8031
8031
  // src/commands/init.ts
8032
- import { execFileSync as execFileSync7, spawn } from "child_process";
8032
+ import { execFileSync as execFileSync8, spawn } from "child_process";
8033
8033
  import { existsSync as existsSync36 } from "fs";
8034
8034
  import { appendFile, mkdir, readFile } from "fs/promises";
8035
8035
  import { homedir as homedir33, platform as platform5 } from "os";
@@ -8039,18 +8039,24 @@ import { dirname as dirname8, join as join36, posix as posix3, win32 } from "pat
8039
8039
  import { platform as platform4 } from "os";
8040
8040
 
8041
8041
  // src/infrastructure/service/linux-systemd.ts
8042
- import { execFileSync as execFileSync5 } from "child_process";
8042
+ import { execFileSync as execFileSync6 } from "child_process";
8043
8043
  import { existsSync as existsSync34, mkdirSync as mkdirSync4, rmSync as rmSync4, writeFileSync as writeFileSync6 } from "fs";
8044
8044
  import { homedir as homedir31, platform as platform2 } from "os";
8045
8045
  import { posix } from "path";
8046
8046
 
8047
8047
  // src/utils/command.ts
8048
- import { execSync } from "child_process";
8048
+ import { execFileSync as execFileSync5 } from "child_process";
8049
8049
  import { platform } from "os";
8050
+ function getCommandCheck(command, currentPlatform = platform()) {
8051
+ if (currentPlatform === "win32") {
8052
+ return { command: "where", args: [command] };
8053
+ }
8054
+ return { command: "/bin/sh", args: ["-c", 'command -v "$1"', "sh", command] };
8055
+ }
8050
8056
  function isCommandAvailable(command) {
8057
+ const check = getCommandCheck(command);
8051
8058
  try {
8052
- const check = platform() === "win32" ? `where ${command}` : `command -v ${command}`;
8053
- execSync(check, { stdio: "ignore", timeout: 5e3 });
8059
+ execFileSync5(check.command, check.args, { stdio: "ignore", timeout: 5e3 });
8054
8060
  return true;
8055
8061
  } catch {
8056
8062
  return false;
@@ -8162,7 +8168,7 @@ function getSystemdSupport() {
8162
8168
  return { ok: true };
8163
8169
  }
8164
8170
  function execSystemctl(args) {
8165
- execFileSync5("systemctl", ["--user", ...args], {
8171
+ execFileSync6("systemctl", ["--user", ...args], {
8166
8172
  stdio: "inherit"
8167
8173
  });
8168
8174
  }
@@ -8361,7 +8367,7 @@ function createLinuxSystemdServiceBackend() {
8361
8367
  }
8362
8368
 
8363
8369
  // src/infrastructure/service/macos-launchd.ts
8364
- import { execFileSync as execFileSync6 } from "child_process";
8370
+ import { execFileSync as execFileSync7 } from "child_process";
8365
8371
  import { existsSync as existsSync35, mkdirSync as mkdirSync5, rmSync as rmSync5, writeFileSync as writeFileSync7 } from "fs";
8366
8372
  import { homedir as homedir32, platform as platform3 } from "os";
8367
8373
  import { posix as posix2 } from "path";
@@ -8459,7 +8465,7 @@ function getLaunchctlSupport() {
8459
8465
  };
8460
8466
  }
8461
8467
  try {
8462
- execFileSync6("launchctl", ["print", getMacosLaunchdDomain(uid)], {
8468
+ execFileSync7("launchctl", ["print", getMacosLaunchdDomain(uid)], {
8463
8469
  stdio: "ignore"
8464
8470
  });
8465
8471
  return { ok: true };
@@ -8471,7 +8477,7 @@ function getLaunchctlSupport() {
8471
8477
  }
8472
8478
  }
8473
8479
  function execLaunchctl(args, inherit = true) {
8474
- execFileSync6("launchctl", args, {
8480
+ execFileSync7("launchctl", args, {
8475
8481
  stdio: inherit ? "inherit" : "ignore"
8476
8482
  });
8477
8483
  }
@@ -8780,7 +8786,7 @@ function resolvePowerShellProfilePath() {
8780
8786
  ];
8781
8787
  for (const command of candidates) {
8782
8788
  try {
8783
- const output = execFileSync7(
8789
+ const output = execFileSync8(
8784
8790
  command,
8785
8791
  [
8786
8792
  "-NoLogo",