@kk306484328/kcli
Version:
下载git仓库作为项目起始模板,可保存模板地址
20 lines (19 loc) • 373 B
JavaScript
const execSync = require('child_process').execSync
module.exports = {
shouldUseYarn () {
try {
execSync('yarnpkg --version', { stdio: 'ignore' })
return true
} catch (e) {
return false
}
},
shouldUseNpm () {
try {
execSync('npm --version').toString().trim()
return true
} catch (err) {
return false
}
}
}