@vue/cli-shared-utils
Advanced tools
Comparing version 3.0.0-alpha.6 to 3.0.0-alpha.7
const { execSync } = require('child_process') | ||
let _hasYarn | ||
let _hasGit | ||
// env detection | ||
exports.hasYarn = (() => { | ||
exports.hasYarn = () => { | ||
if (process.env.VUE_CLI_TEST) { | ||
return true | ||
} | ||
if (_hasYarn != null) { | ||
return _hasYarn | ||
} | ||
try { | ||
execSync('yarnpkg --version', { stdio: 'ignore' }) | ||
return true | ||
return (_hasYarn = true) | ||
} catch (e) { | ||
return false | ||
return (_hasYarn = false) | ||
} | ||
})() | ||
} | ||
@@ -20,8 +26,11 @@ exports.hasGit = () => { | ||
} | ||
if (_hasGit != null) { | ||
return _hasGit | ||
} | ||
try { | ||
execSync('git --version', { stdio: 'ignore' }) | ||
return true | ||
return (_hasGit = true) | ||
} catch (e) { | ||
return false | ||
return (_hasGit = false) | ||
} | ||
} |
{ | ||
"name": "@vue/cli-shared-utils", | ||
"version": "3.0.0-alpha.6", | ||
"version": "3.0.0-alpha.7", | ||
"description": "shared utilities for vue-cli packages", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
10238
266