Skip to content

Commit

Permalink
fix afterInvoke/onCreateComplete callbacks in Migrator (#5062)
Browse files Browse the repository at this point in the history
closes #4837
  • Loading branch information
sodatea authored and pksunkara committed Jan 13, 2020
1 parent 1c269d2 commit 42bd09f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/Migrator.js
Expand Up @@ -6,14 +6,14 @@ module.exports = class Migrator extends Generator {
plugin,

pkg = {},
completeCbs = [],
afterInvokeCbs = [],
files = {},
invoking = false
} = {}) {
super(context, {
pkg,
plugins: [],
completeCbs,
afterInvokeCbs,
files,
invoking
})
Expand Down
8 changes: 4 additions & 4 deletions packages/@vue/cli/lib/Upgrader.js
Expand Up @@ -118,13 +118,13 @@ module.exports = class Upgrader {
installed: options.installed
}

const createCompleteCbs = []
const afterInvokeCbs = []
const migrator = new Migrator(this.context, {
plugin: plugin,

pkg: this.pkg,
files: await readFiles(this.context),
completeCbs: createCompleteCbs,
afterInvokeCbs,
invoking: true
})

Expand All @@ -146,9 +146,9 @@ module.exports = class Upgrader {
await this.pm.install()
}

if (createCompleteCbs.length) {
if (afterInvokeCbs.length) {
logWithSpinner('⚓', `Running completion hooks...`)
for (const cb of createCompleteCbs) {
for (const cb of afterInvokeCbs) {
await cb()
}
stopSpinner()
Expand Down

0 comments on commit 42bd09f

Please sign in to comment.