Skip to content

Commit

Permalink
Add node modules and compiled JavaScript from main
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverMKing committed Jun 22, 2022
1 parent d7aa5d1 commit 42bec60
Show file tree
Hide file tree
Showing 10,167 changed files with 2,219,599 additions and 2 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
node_modules

.DS_Store
.idea
lib/
39 changes: 39 additions & 0 deletions lib/exec-child.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
if (require.main !== module) {
throw new Error('This file should not be required');
}

var childProcess = require('child_process');
var fs = require('fs');

var paramFilePath = process.argv[2];

var serializedParams = fs.readFileSync(paramFilePath, 'utf8');
var params = JSON.parse(serializedParams);

var cmd = params.command;
var execOptions = params.execOptions;
var pipe = params.pipe;
var stdoutFile = params.stdoutFile;
var stderrFile = params.stderrFile;

var c = childProcess.exec(cmd, execOptions, function (err) {
if (!err) {
process.exitCode = 0;
} else if (err.code === undefined) {
process.exitCode = 1;
} else {
process.exitCode = err.code;
}
});

var stdoutStream = fs.createWriteStream(stdoutFile);
var stderrStream = fs.createWriteStream(stderrFile);

c.stdout.pipe(stdoutStream);
c.stderr.pipe(stderrStream);
c.stdout.pipe(process.stdout);
c.stderr.pipe(process.stderr);

if (pipe) {
c.stdin.end(pipe);
}
Loading

0 comments on commit 42bec60

Please sign in to comment.