Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-50-spawn / test-exec-2.js
512 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | var exec = require('child_process').exec; |
6 | |
7 | var child = exec( |
8 | '"' + process.execPath + '" ' + [ |
9 | require.resolve('./test-exec-child.js'), 'argvx', '--argvy' |
10 | ].join(' '), |
11 | function (error) { |
12 | if (error) return console.error(error); |
13 | console.log('exec done'); |
14 | } |
15 | ); |
16 | |
17 | child.stdout.pipe(process.stdout); |
18 | child.stderr.pipe(process.stderr); |
19 | |
20 | child.on('exit', function (code) { |
21 | setTimeout(function () { |
22 | console.log('Child exited with code', code); |
23 | }, 100); |
24 | }); |
25 |
Built with git-ssb-web