avoid checking latency twice

This commit is contained in:
Evan You
2018-01-03 04:08:21 -05:00
parent 2c47f915a3
commit 2a0b91655d
2 changed files with 5 additions and 5 deletions

View File

@@ -72,7 +72,7 @@ module.exports = class Creator {
// in development, avoid installation process
setupDevProject(context, deps)
} else {
await installDeps(context, options, deps)
await installDeps(context, options.packageManager, deps)
}
// run generator
@@ -90,7 +90,7 @@ module.exports = class Creator {
// install additional deps (injected by generators)
logWithSpinner('📦', `Installing additional dependencies...`)
if (!process.env.VUE_CLI_TEST) {
await installDeps(context, options)
await installDeps(context, options.packageManager)
}
// run complete cbs if any (injected by generators)

View File

@@ -26,9 +26,9 @@ const findFastestRegistry = () => {
}))
}
module.exports = async function installDeps (targetDir, options, deps) {
const command = options.packageManager
const registry = await findFastestRegistry()
let registry
module.exports = async function installDeps (targetDir, command, deps) {
registry = registry || await findFastestRegistry()
await new Promise((resolve, reject) => {
const args = []