Skip to content

Commit

Permalink
fix: throw error on invalid glob pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jun 27, 2020
1 parent d3f21e9 commit 70bd152
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ export const extractStories = ({
? config.stories.reduce((acc: string[], storyRg: string) => {
//fix for sb5 issue handling glob
const regex = storyRg.replace('.(', '.@(');
return [...acc, ...globSync(path.resolve(configPath, regex))];
const matches = globSync(path.resolve(configPath, regex));
if (!matches.length) {
throw new Error(`${storyRg} did not match any files`);
}
return [...acc, ...matches];
}, [])
: undefined;
return stories;
Expand Down

0 comments on commit 70bd152

Please sign in to comment.