mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-14 03:11:19 -06:00
27 lines
460 B
JavaScript
27 lines
460 B
JavaScript
const { execSync } = require('child_process')
|
|
|
|
// env detection
|
|
exports.hasYarn = (() => {
|
|
if (process.env.VUE_CLI_TEST) {
|
|
return true
|
|
}
|
|
try {
|
|
execSync('yarnpkg --version', { stdio: 'ignore' })
|
|
return true
|
|
} catch (e) {
|
|
return false
|
|
}
|
|
})()
|
|
|
|
exports.hasGit = () => {
|
|
if (process.env.VUE_CLI_TEST) {
|
|
return true
|
|
}
|
|
try {
|
|
execSync('git --version', { stdio: 'ignore' })
|
|
return true
|
|
} catch (e) {
|
|
return false
|
|
}
|
|
}
|