diff --git a/package-lock.json b/package-lock.json index 14baf96..38270f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -876,7 +876,6 @@ "integrity": "sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -1394,7 +1393,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", @@ -1901,7 +1899,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2433,7 +2430,6 @@ "integrity": "sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -2642,7 +2638,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/src/executor.ts b/src/executor.ts index 34a5064..0f287cd 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -9,7 +9,6 @@ import { ExecutionOptions, CommandCodeResult } from "./types.js"; import { resolveCommandCodePath } from "./resolver.js"; import { executeMock } from "./mock.js"; import { - IS_WINDOWS, MAX_PARTIAL_OUTPUT_CHARS, STREAM_CHUNK_INTERVAL_MS, } from "./constants.js"; @@ -19,7 +18,7 @@ import { * * - Checks COMMANDCODE_MOCK env var and delegates to mock executor if set. * - Resolves the CLI binary path via the resolver module. - * - Spawns the process with shell: true on Windows, shell: false on Unix. + * - Spawns the process with shell: false on all platforms (resolver handles PATH/shim resolution). * - Always includes `--skip-onboarding` in the args. * - Applies timeout via AbortController + setTimeout. * - On timeout: SIGTERM → wait 2s → SIGKILL → collect partial output (up to 10,000 chars). diff --git a/src/resolver.ts b/src/resolver.ts index a11c355..207a85b 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -45,7 +45,7 @@ function findOnPath(name: string): string | null { ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";") : [""]; - for (const dir of pathEnv.split(delimiter)) { + for (const dir of pathEnv.split(IS_WINDOWS ? ";" : delimiter)) { if (!dir) continue; for (const ext of exts) { const candidate = join(dir, name + ext);