Skip to content

Commit fe71fd3

Browse files
authored
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
1 parent 9150ab1 commit fe71fd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function run() {
2525
if (config.input_files) {
2626
const patterns = unmatchedPatterns(config.input_files);
2727
patterns.forEach((pattern) =>
28-
console.warn(`🤔 Pattern '${pattern}' does not match any files.`)
28+
throw new Error(`⚠️ Pattern '${pattern}' does not match any files.`)
2929
);
3030
if (patterns.length > 0 && config.input_fail_on_unmatched_files) {
3131
throw new Error(`⚠️ There were unmatched files`);
@@ -63,7 +63,7 @@ async function run() {
6363
if (config.input_files && config.input_files.length > 0) {
6464
const files = paths(config.input_files);
6565
if (files.length == 0) {
66-
console.warn(`🤔 ${config.input_files} not include valid file.`);
66+
throw new Error(`⚠️ ${config.input_files} not include valid file.`);
6767
}
6868
const currentAssets = rel.assets;
6969
const assets = await Promise.all(

0 commit comments

Comments
 (0)