zarro 1.185.0 → 1.186.0
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/gulp-tasks/modules/system.js +15 -0
- package/package.json +1 -1
- package/types.d.ts +13 -1
|
@@ -91,6 +91,21 @@ ${tempFileContents}
|
|
|
91
91
|
const result = new SystemResult(`${exe}`, programArgs, undefined, [], []);
|
|
92
92
|
return new Promise((resolve, reject) => {
|
|
93
93
|
const child = child_process.spawn(exe, programArgs, spawnOptions);
|
|
94
|
+
if (!!options) {
|
|
95
|
+
const optsWithKill = options;
|
|
96
|
+
optsWithKill.kill = (signal) => {
|
|
97
|
+
destroyPipesOn(child);
|
|
98
|
+
child.kill(signal);
|
|
99
|
+
};
|
|
100
|
+
if (optsWithKill === null || optsWithKill === void 0 ? void 0 : optsWithKill.onChildSpawned) {
|
|
101
|
+
try {
|
|
102
|
+
optsWithKill.onChildSpawned(child, optsWithKill);
|
|
103
|
+
}
|
|
104
|
+
catch (e) {
|
|
105
|
+
// suppress
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
94
109
|
const stdoutFn = typeof opts.stdout === "function" ? opts.stdout : noop;
|
|
95
110
|
const stderrFn = typeof opts.stderr === "function" ? opts.stderr : noop;
|
|
96
111
|
const stdoutLineBuffer = new LineBuffer(s => {
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { StatsBase } from "fs";
|
|
|
5
5
|
import { Stream, Transform } from "stream";
|
|
6
6
|
import ansiColors, { StyleFunction } from "ansi-colors";
|
|
7
7
|
import { RimrafOptions } from "./gulp-tasks/modules/rimraf";
|
|
8
|
-
import { ExecFileOptionsWithBufferEncoding } from "child_process";
|
|
8
|
+
import { ChildProcess, ExecFileOptionsWithBufferEncoding } from "child_process";
|
|
9
9
|
import * as vinyl from "vinyl";
|
|
10
10
|
import { BufferFile } from "vinyl";
|
|
11
11
|
// noinspection ES6PreferShortImport
|
|
@@ -1095,6 +1095,7 @@ declare global {
|
|
|
1095
1095
|
* io writer or the result from after spawn completes
|
|
1096
1096
|
*/
|
|
1097
1097
|
suppressOutput?: boolean;
|
|
1098
|
+
|
|
1098
1099
|
}
|
|
1099
1100
|
|
|
1100
1101
|
interface SystemOptions {
|
|
@@ -1134,6 +1135,17 @@ declare global {
|
|
|
1134
1135
|
* / error as the first argument, with the exe set to either cmd or sh
|
|
1135
1136
|
*/
|
|
1136
1137
|
keepTempFiles?: boolean;
|
|
1138
|
+
|
|
1139
|
+
// gain direct access to the child process as
|
|
1140
|
+
// soon as it spawns
|
|
1141
|
+
onChildSpawned?: (child: ChildProcess, originalOptions: SystemOptionsWithKill) => void;
|
|
1142
|
+
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
interface SystemOptionsWithKill extends SystemOptions {
|
|
1146
|
+
// this function will be filled in for you once the
|
|
1147
|
+
// child process has started
|
|
1148
|
+
kill: (signal?: NodeJS.Signals | number) => void;
|
|
1137
1149
|
}
|
|
1138
1150
|
|
|
1139
1151
|
/**
|