fix: plugin.options can be missing when runGenerator is directly called

fixes #2906
This commit is contained in:
Haoqun Jiang
2018-11-12 15:27:49 +08:00
parent 077343ba6a
commit d1cd4aa6a2

View File

@@ -139,7 +139,7 @@ async function runGenerator (context, plugin, pkg = getPkg(context)) {
log()
const packageManager =
loadOptions().packageManager || (hasProjectYarn(context) ? 'yarn' : 'npm')
await installDeps(context, packageManager, plugin.options.registry)
await installDeps(context, packageManager, plugin.options && plugin.options.registry)
}
if (createCompleteCbs.length) {