Skip to content

Commit 27bfb38

Browse files
author
GitHub Action
committed
build
1 parent a72463c commit 27bfb38

File tree

3 files changed

+192230
-1
lines changed

3 files changed

+192230
-1
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -331,4 +331,3 @@ node_modules
331331
coverage
332332

333333
# Transpiled JS
334-
lib/

Diff for: lib/exec-child.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
if (require.main !== module) {
2+
throw new Error('This file should not be required');
3+
}
4+
5+
var childProcess = require('child_process');
6+
var fs = require('fs');
7+
8+
var paramFilePath = process.argv[2];
9+
10+
var serializedParams = fs.readFileSync(paramFilePath, 'utf8');
11+
var params = JSON.parse(serializedParams);
12+
13+
var cmd = params.command;
14+
var execOptions = params.execOptions;
15+
var pipe = params.pipe;
16+
var stdoutFile = params.stdoutFile;
17+
var stderrFile = params.stderrFile;
18+
19+
var c = childProcess.exec(cmd, execOptions, function (err) {
20+
if (!err) {
21+
process.exitCode = 0;
22+
} else if (err.code === undefined) {
23+
process.exitCode = 1;
24+
} else {
25+
process.exitCode = err.code;
26+
}
27+
});
28+
29+
var stdoutStream = fs.createWriteStream(stdoutFile);
30+
var stderrStream = fs.createWriteStream(stderrFile);
31+
32+
c.stdout.pipe(stdoutStream);
33+
c.stderr.pipe(stderrStream);
34+
c.stdout.pipe(process.stdout);
35+
c.stderr.pipe(process.stderr);
36+
37+
if (pipe) {
38+
c.stdin.end(pipe);
39+
}

0 commit comments

Comments
 (0)