From fe71fd3b919b0ad8636bb9a2930b15466814fbb7 Mon Sep 17 00:00:00 2001 From: Ryan Delaney <1139517+rpdelaney@users.noreply.github.com> Date: Fri, 8 Mar 2024 21:10:05 +0000 Subject: [PATCH] Don't swallow errors (#384) * Change 'pattern does not match any files' warning to fatal Fixes #383 * Raise a fatal error if the config file is not valid Related to #383 --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 19d31864f..f5f7f3997 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,7 @@ async function run() { if (config.input_files) { const patterns = unmatchedPatterns(config.input_files); patterns.forEach((pattern) => - console.warn(`🤔 Pattern '${pattern}' does not match any files.`) + throw new Error(`⚠️ Pattern '${pattern}' does not match any files.`) ); if (patterns.length > 0 && config.input_fail_on_unmatched_files) { throw new Error(`⚠️ There were unmatched files`); @@ -63,7 +63,7 @@ async function run() { if (config.input_files && config.input_files.length > 0) { const files = paths(config.input_files); if (files.length == 0) { - console.warn(`🤔 ${config.input_files} not include valid file.`); + throw new Error(`⚠️ ${config.input_files} not include valid file.`); } const currentAssets = rel.assets; const assets = await Promise.all(