chore: updated error message for not-found fuzzy-matching error (#303)
This commit is contained in:
parent
db5c343c33
commit
b60355d857
@ -1,4 +1,5 @@
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const chalk = require('chalk')
|
||||||
|
|
||||||
const targets = (exports.targets = fs.readdirSync('packages').filter(f => {
|
const targets = (exports.targets = fs.readdirSync('packages').filter(f => {
|
||||||
if (!fs.statSync(`packages/${f}`).isDirectory()) {
|
if (!fs.statSync(`packages/${f}`).isDirectory()) {
|
||||||
@ -26,6 +27,14 @@ exports.fuzzyMatchTarget = (partialTargets, includeAllMatching) => {
|
|||||||
if (matched.length) {
|
if (matched.length) {
|
||||||
return matched
|
return matched
|
||||||
} else {
|
} 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user