mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-16 01:41:15 +08:00
21 lines
366 B
JavaScript
21 lines
366 B
JavaScript
'use strict';
|
|
|
|
const getRunCmdEnv = require('./utils/getRunCmdEnv');
|
|
|
|
function runCmd(cmd, _args, fn) {
|
|
const args = _args || [];
|
|
const runner = require('child_process').spawn(cmd, args, {
|
|
// keep color
|
|
stdio: 'inherit',
|
|
env: getRunCmdEnv(),
|
|
});
|
|
|
|
runner.on('close', code => {
|
|
if (fn) {
|
|
fn(code);
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = runCmd;
|