Skip to content

Commit

Permalink
Improve checking for Storybook v7
Browse files Browse the repository at this point in the history
I came across a case where Storybook 7 was used but the plugin still
detected v6. Going to add another v7 check to make things more robust.
  • Loading branch information
trotzig committed Dec 22, 2023
1 parent 16dbaad commit 948618f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ function resolveBuildCommandParts() {
console.log('[happo] Check for Storybook v6 failed. Details:', e);
}
}
try {
execSync(`${binary} storybook --version`);
// Storybook v7 or later
return ['storybook', 'build'];
} catch (e) {
if (HAPPO_DEBUG) {
console.log(
'[happo] Check for Storybook v7 failed. Details:',
e,
);
}
}
try {
execSync(`${binary} build-storybook --version`);
return ['build-storybook'];
Expand Down

0 comments on commit 948618f

Please sign in to comment.