make pattern error opt in (#417)

* make pattern error opt in

* changelog link
This commit is contained in:
Doug Tangren authored and GitHub committed 2024-03-10 00:56:17 -05:00
1 parent 20e085ccc7
commit 0e39c679e8
2 files changed
+7 -1

No files matched your search

+5 -1
View File
@@ -25,7 +25,11 @@ async function run() {
if (config.input_files) {
const patterns = unmatchedPatterns(config.input_files);
patterns.forEach((pattern) => {
throw new Error(`⚠️ Pattern '${pattern}' does not match any files.`);
if (config.input_fail_on_unmatched_files) {
throw new Error(`⚠️ Pattern '${pattern}' does not match any files.`);
} else {
console.warn(`🤔 Pattern '${pattern}' does not match any files.`);
}
});
if (patterns.length > 0 && config.input_fail_on_unmatched_files) {
throw new Error(`⚠️ There were unmatched files`);