1 | 'use strict';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | const childProcess = require('child_process');
|
7 | const path = require('path');
|
8 |
|
9 | function systemSync(cmd) {
|
10 | childProcess.exec(cmd, (err, stdout, stderr) => {
|
11 | console.log(`stdout is: ${stdout}`);
|
12 | console.log(`stderr is: ${stderr}`);
|
13 | console.log(`error is: ${err}`);
|
14 | }).on('exit', code => {
|
15 | console.log('final exit code is', code);
|
16 | });
|
17 | }
|
18 |
|
19 | const cmd = `node ${path.join(__dirname, '../lib/index.js')} ${process.argv.slice(2).join(' ')}`;
|
20 |
|
21 | console.log(cmd);
|
22 | systemSync(cmd); |
\ | No newline at end of file |