Skip to content

Commit

Permalink
Fix split on undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jun 18, 2022
1 parent 5820e3d commit 8be428f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin-src/lib/getStorybookConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default function getStorybookConfiguration(
shortName: string,
longName?: string
) {
if (!storybookScript) return null;
const parts = storybookScript.split(/[\s='"]+/);
let index = parts.indexOf(longName);
if (index === -1) {
Expand Down
5 changes: 3 additions & 2 deletions bin-src/ui/tasks/storybookInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ const infoMessage = ({ addons, version, viewLayer, builder }: Context['storybook
const builderInfo = builder
? `${info}; using the ${builder.name} builder (${builder.packageVersion})`
: info;
return addons?.length
? `${builderInfo}; supported addons found: ${addons
const supportedAddons = addons.filter((addon) => addon && addon.name);
return supportedAddons?.length
? `${builderInfo}; supported addons found: ${supportedAddons
.map((addon) => capitalize(addon.name))
.join(', ')}`
: `${builderInfo}; no supported addons found`;
Expand Down

0 comments on commit 8be428f

Please sign in to comment.