Skip to content

Commit

Permalink
Don't swallow errors (#384)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rpdelaney committed Mar 8, 2024
1 parent 9150ab1 commit fe71fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Expand Up @@ -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`);
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit fe71fd3

Please sign in to comment.