From: Ivan Sieder <35377072+ivansieder@users.noreply.github.com> Date: Tue, 15 Oct 2019 21:13:35 +0000 (+0200) Subject: chore: updated error message for not-found fuzzy-matching error (#303) X-Git-Tag: v3.0.0-alpha.0~417 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b60355d857840af3d7a1d58a7b6c2ea40c8bf0b4;p=thirdparty%2Fvuejs%2Fcore.git chore: updated error message for not-found fuzzy-matching error (#303) --- diff --git a/scripts/utils.js b/scripts/utils.js index 89acd7707a..04b0dfc679 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -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) } }