diff --git a/.yarn/juke/index.d.ts b/.yarn/juke/index.d.ts index cdc30ea..3f8ef8a 100644 --- a/.yarn/juke/index.d.ts +++ b/.yarn/juke/index.d.ts @@ -3,7 +3,7 @@ /// import _chalk from 'chalk'; -import { SpawnOptionsWithoutStdio } from 'child_process'; +import { SpawnOptions } from 'child_process'; import EventEmitter from 'events'; /** @@ -166,7 +166,7 @@ export declare class ExitCode extends Error { signal: string | null; constructor(code: number | null, signal?: string | null); } -export declare type ExecOptions = SpawnOptionsWithoutStdio & { +export declare type ExecOptions = SpawnOptions & { /** * If `true`, this exec call will not pipe its output to stdio. * @default false @@ -177,6 +177,11 @@ export declare type ExecOptions = SpawnOptionsWithoutStdio & { * @default true */ throw?: boolean; + /** + * Captures stdout/stderr to be available in exec return value. + * This is experimental functionality. + */ + captureOutput?: boolean; }; export declare type ExecReturn = { /** Exit code of the program. */ diff --git a/.yarn/juke/index.js b/.yarn/juke/index.js index 4ee8fbf..2443dac 100644 --- a/.yarn/juke/index.js +++ b/.yarn/juke/index.js @@ -4323,7 +4323,7 @@ var import_chalk4 = __toModule(require_source()); var import_module = __toModule(require("module")); // pnp:/Users/style/Documents/Projects/juke-build/package.json -var version = "0.8.1"; +var version = "0.9.0"; // pnp:/Users/style/Documents/Projects/juke-build/src/chdir.ts var import_fs = __toModule(require("fs")); @@ -4404,25 +4404,31 @@ var exec = (executable, args = [], options = {}) => { if (process.env.JUKE_DEBUG) { console.log(import_chalk.default.grey("$", executable, ...args)); } - const child = (0, import_child_process.spawn)(executable, args, spawnOptions); + const child = (0, import_child_process.spawn)(executable, args, __spreadValues({ + stdio: "inherit" + }, spawnOptions)); children.add(child); let stdout = ""; let stderr = ""; let combined = ""; - child.stdout.on("data", (data) => { - if (!silent) { - process.stdout.write(data); - } - stdout += data; - combined += data; - }); - child.stderr.on("data", (data) => { - if (!silent) { - process.stderr.write(data); - } - stderr += data; - combined += data; - }); + if (child.stdout) { + child.stdout.on("data", (data) => { + if (!silent) { + process.stdout.write(data); + } + stdout += data; + combined += data; + }); + } + if (child.stderr) { + child.stderr.on("data", (data) => { + if (!silent) { + process.stderr.write(data); + } + stderr += data; + combined += data; + }); + } child.on("error", (err) => reject(err)); child.on("exit", (code, signal) => { children.delete(child); diff --git a/package.json b/package.json index b6a460e..0c01a30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "juke-build", - "version": "0.8.1", + "version": "0.9.0", "description": "The AKE-less Build System for JavaScript and Node.js.", "keywords": [ "build",