Skip to content

Commit 646781b

Browse files
committed
Tweak the bundle validation script
Exit on error, and minor nits.
1 parent da86a45 commit 646781b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

scripts/rollup/validate/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,14 @@ function lint({format, filePatterns}) {
3939

4040
function checkFilesExist(bundle) {
4141
const {format, filePatterns} = bundle;
42-
filePatterns.map(pattern => {
43-
console.log(`Check if files exist in ${pattern}`);
42+
filePatterns.forEach(pattern => {
43+
console.log(`Checking if files exist in ${pattern}...`);
4444
const files = glob.sync(pattern);
4545
if (files.length === 0) {
46-
console.error(
47-
chalk.red(
48-
`No files found in glob pattern ${pattern} in ${format} bundle.`
49-
)
50-
);
51-
process.exit();
46+
console.error(chalk.red(`Found no ${format} bundles in ${pattern}`));
47+
process.exit(1);
5248
} else {
53-
console.log(chalk.green(`${files.length} files found.`));
49+
console.log(chalk.green(`Found ${files.length} bundles.`));
5450
console.log();
5551
}
5652
});

0 commit comments

Comments
 (0)