UNPKG

616 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(`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
19const cmd = `node ${path.join(__dirname, '../lib/index.js')} ${process.argv.slice(2).join(' ')}`;
20
21console.log(`dev: run ${cmd}`);
22systemSync(cmd);
\No newline at end of file