Skip to content

Commit e06355b

Browse files
fix(bug): minor fix
1 parent c30a6a9 commit e06355b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/@vue/cli/bin/vue.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const semver = require('semver')
88
const requiredVersion = require('../package.json').engines.node
99
const didYouMean = require('didyoumean')
1010

11+
// Setting edit distance to 60% of the input string's length
12+
didYouMean.threshold = 0.6
13+
1114
function checkNodeVersion (wanted, id) {
1215
if (!semver.satisfies(process.version, wanted)) {
1316
console.log(chalk.red(
@@ -190,12 +193,11 @@ program
190193
).then(console.log)
191194
})
192195

193-
suggestCommands(process.argv.slice(2)[0])
194-
195196
// output help information on unknown commands
196197
program
197198
.arguments('<command>')
198199
.action((cmd) => {
200+
suggestCommands(cmd)
199201
program.outputHelp()
200202
console.log(` ` + chalk.red(`Unknown command ${chalk.yellow(cmd)}.`))
201203
console.log()
@@ -241,7 +243,6 @@ function suggestCommands (cmd) {
241243
const suggestion = didYouMean(cmd, availableCommands)
242244
if (suggestion) {
243245
console.log(chalk.cyan(`Warning: ${chalk.yellow(`Did you mean ${suggestion} ?`)}`))
244-
process.exit(1)
245246
}
246247
}
247248

0 commit comments

Comments
 (0)