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(`dev: stdout is ${stdout}`);
|
12 | console.log(`dev: stderr is ${stderr}`);
|
13 | console.log(`dev: error is ${err}`);
|
14 | }).on('exit', code => {
|
15 | console.log('dev: 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(`dev: run ${cmd}`);
|
22 | systemSync(cmd); |
\ | No newline at end of file |