mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-26 00:26:53 +08:00
27 lines
490 B
JavaScript
27 lines
490 B
JavaScript
/* eslint strict: 0 */
|
|
'use strict';
|
|
|
|
function runCmd(cmd, args, fn) {
|
|
args = args || [];
|
|
const runner = require('child_process').spawn(cmd, args, {
|
|
// keep color
|
|
stdio: 'inherit'
|
|
});
|
|
runner.on('close', (code) => {
|
|
if (fn) {
|
|
fn(code);
|
|
}
|
|
});
|
|
}
|
|
|
|
runCmd('which', ['tnpm'], (code) => {
|
|
let npm = 'npm';
|
|
if (!code) {
|
|
npm = 'tnpm';
|
|
}
|
|
console.log(`${npm} installing`);
|
|
runCmd(npm, ['install'], () => {
|
|
console.log(`${npm} install end`);
|
|
});
|
|
});
|