vue-cli-plugin-vusion
Version:
Vue CLI Plugin for Vusion Projects
13 lines (12 loc) • 382 B
JavaScript
const spawnSync = require('child_process').spawnSync;
/**
* 使用 spawn inherit,直接打印 stdio
*/
module.exports = (command, onError) => {
[command, ...args] = command.split(/\s+/);
const result = spawnSync(command, args, { shell: true, stdio: 'inherit' });
if (result.status) {
onError && onError(result);
process.exit(1);
}
};