1 | const { sync: spawnSync } = require('cross-spawn');
|
2 | const path = require('path');
|
3 |
|
4 | const CLI_PATH = path.join(__dirname, '..', 'bin');
|
5 |
|
6 | /**
|
7 | * Execute command
|
8 | * @param {String[]} args - args to be passed in
|
9 | * @param {Object} options - customize the behavior
|
10 | *
|
11 | * @returns {Object}
|
12 | */
|
13 | const run = (args, options = {}) => spawnSync('node', [CLI_PATH].concat(args), options);
|
14 |
|
15 | module.exports = run;
|