kooni-bot 0.2.3 → 0.2.4
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/bin/kooni.js +8 -7
- package/package.json +1 -1
package/bin/kooni.js
CHANGED
|
@@ -22,7 +22,7 @@ import { execFileSync, spawnSync } from "node:child_process";
|
|
|
22
22
|
import { randomUUID } from "node:crypto";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
|
|
25
|
-
const CLI_VERSION = "0.2.
|
|
25
|
+
const CLI_VERSION = "0.2.4";
|
|
26
26
|
|
|
27
27
|
const REPO = process.env.KOONI_REPO || "iamnocodeveloper/kooni-bot";
|
|
28
28
|
const BRANCH = process.env.KOONI_BRANCH || "main";
|
|
@@ -499,9 +499,11 @@ const isWin = process.platform === "win32";
|
|
|
499
499
|
|
|
500
500
|
// Ejecuta un binario de forma segura en Windows/macOS/Linux:
|
|
501
501
|
// - Unix/mac: `spawnSync(file, args)` directo.
|
|
502
|
-
// - Windows: `npx`/`pnpm` son shims
|
|
503
|
-
//
|
|
504
|
-
//
|
|
502
|
+
// - Windows: `npx`/`pnpm` son shims, pero `cmd.exe /c` los resuelve SIN la
|
|
503
|
+
// extensión `.cmd` (probado: `cmd.exe /c pnpm --version` funciona, mientras
|
|
504
|
+
// que `pnpm.cmd` explícito falla con "no se reconoce"). Así que aquí NO se
|
|
505
|
+
// mapea a `.cmd`: se lanza `cmd.exe /c <file> <args...>` con args separados.
|
|
506
|
+
// Nada de `shell: true` ni concatenación → sin EINVAL ni DEP0190.
|
|
505
507
|
// - `stdio` hereda por defecto (progreso en vivo); `capture` captura para parsear.
|
|
506
508
|
function run(file, args = [], opts = {}) {
|
|
507
509
|
const cwd = opts.cwd;
|
|
@@ -512,15 +514,14 @@ function run(file, args = [], opts = {}) {
|
|
|
512
514
|
let argv = args;
|
|
513
515
|
|
|
514
516
|
if (isWin) {
|
|
515
|
-
const shim = { npx: "npx.cmd", pnpm: "pnpm.cmd" }[file] || file;
|
|
516
517
|
cmd = "cmd.exe";
|
|
517
|
-
argv = ["/d", "/c",
|
|
518
|
+
argv = ["/d", "/c", file, ...args];
|
|
518
519
|
}
|
|
519
520
|
|
|
520
521
|
const r = spawnSync(cmd, argv, { cwd, input, stdio, encoding: "utf8" });
|
|
521
522
|
if (r.error) throw r.error;
|
|
522
523
|
if (r.status !== 0) {
|
|
523
|
-
const err = new Error(`Command failed: ${[
|
|
524
|
+
const err = new Error(`Command failed: ${[file, ...args].join(" ")}`);
|
|
524
525
|
err.stdout = r.stdout;
|
|
525
526
|
err.stderr = r.stderr;
|
|
526
527
|
err.status = r.status;
|
package/package.json
CHANGED