File tree 3 files changed +192230
-1
lines changed
3 files changed +192230
-1
lines changed Original file line number Diff line number Diff line change @@ -331,4 +331,3 @@ node_modules
331
331
coverage
332
332
333
333
# Transpiled JS
334
- lib /
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments