From b60355d857840af3d7a1d58a7b6c2ea40c8bf0b4 Mon Sep 17 00:00:00 2001 From: Ivan Sieder <35377072+ivansieder@users.noreply.github.com> Date: Tue, 15 Oct 2019 23:13:35 +0200 Subject: [PATCH] chore: updated error message for not-found fuzzy-matching error (#303) --- scripts/utils.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) } } -- 2.47.3