]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: updated error message for not-found fuzzy-matching error (#303)
authorIvan Sieder <35377072+ivansieder@users.noreply.github.com>
Tue, 15 Oct 2019 21:13:35 +0000 (23:13 +0200)
committerEvan You <yyx990803@gmail.com>
Tue, 15 Oct 2019 21:13:35 +0000 (17:13 -0400)
scripts/utils.js

index 89acd7707a1194be567e9813d800e8cae9bf8cff..04b0dfc6790244881c61c6780bae5d498c8502da 100644 (file)
@@ -1,4 +1,5 @@
 const fs = require('fs')
+const chalk = require('chalk')
 
 const targets = (exports.targets = fs.readdirSync('packages').filter(f => {
   if (!fs.statSync(`packages/${f}`).isDirectory()) {
@@ -26,6 +27,14 @@ exports.fuzzyMatchTarget = (partialTargets, includeAllMatching) => {
   if (matched.length) {
     return matched
   } else {
-    throw new Error(`Target ${partialTargets} not found!`)
+    console.log()
+    console.error(
+      `  ${chalk.bgRed.white(' ERROR ')} ${chalk.red(
+        `Target ${chalk.underline(partialTargets)} not found!`
+      )}`
+    )
+    console.log()
+
+    process.exit(1)
   }
 }