Skip to content

Commit c7c9144

Browse files
haoqunjiangmactanxin
authored andcommitted
fix afterInvoke/onCreateComplete callbacks in Migrator (vuejs#5062)
closes vuejs#4837
1 parent 8540ae2 commit c7c9144

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/@vue/cli/lib/Migrator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ module.exports = class Migrator extends Generator {
66
plugin,
77

88
pkg = {},
9-
completeCbs = [],
9+
afterInvokeCbs = [],
1010
files = {},
1111
invoking = false
1212
} = {}) {
1313
super(context, {
1414
pkg,
1515
plugins: [],
16-
completeCbs,
16+
afterInvokeCbs,
1717
files,
1818
invoking
1919
})

packages/@vue/cli/lib/Upgrader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ module.exports = class Upgrader {
118118
installed: options.installed
119119
}
120120

121-
const createCompleteCbs = []
121+
const afterInvokeCbs = []
122122
const migrator = new Migrator(this.context, {
123123
plugin: plugin,
124124

125125
pkg: this.pkg,
126126
files: await readFiles(this.context),
127-
completeCbs: createCompleteCbs,
127+
afterInvokeCbs,
128128
invoking: true
129129
})
130130

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

149-
if (createCompleteCbs.length) {
149+
if (afterInvokeCbs.length) {
150150
logWithSpinner('⚓', `Running completion hooks...`)
151-
for (const cb of createCompleteCbs) {
151+
for (const cb of afterInvokeCbs) {
152152
await cb()
153153
}
154154
stopSpinner()

0 commit comments

Comments
 (0)