Skip to content

Commit

Permalink
v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stylemistake committed Aug 17, 2021
1 parent e34e235 commit 5e079dd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
9 changes: 7 additions & 2 deletions .yarn/juke/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <reference types="node" />

import _chalk from 'chalk';
import { SpawnOptionsWithoutStdio } from 'child_process';
import { SpawnOptions } from 'child_process';
import EventEmitter from 'events';

/**
Expand Down Expand Up @@ -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
Expand All @@ -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. */
Expand Down
38 changes: 22 additions & 16 deletions .yarn/juke/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 5e079dd

Please sign in to comment.