Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix afterInvoke/onCreateComplete callbacks in Migrator #5062

Merged
merged 1 commit into from Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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