UNPKG

585 BJavaScriptView Raw
1'use strict';
2
3/* eslint-disable no-console */
4// Helper function to get the exit status code.
5
6const childProcess = require('child_process');
7const path = require('path');
8
9function 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
19const cmd = `node ${path.join(__dirname, '../lib/index.js')} ${process.argv.slice(2).join(' ')}`;
20
21console.log(cmd);
22systemSync(cmd);
\No newline at end of file