Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen authored and shilman committed Mar 17, 2024
1 parent 31a6c06 commit 7750f00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/lib/cli/src/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
getStorybookInfo,
loadMainConfig,
JsPackageManagerFactory,
getCoercedStorybookVersion,
} from '@storybook/core-common';
import { automigrate } from './automigrate/index';
import { autoblock } from './autoblock/index';
Expand Down Expand Up @@ -141,10 +142,11 @@ export const doUpgrade = async ({
throw new UpgradeStorybookToSameVersionError({ beforeVersion });
}

const [latestVersion, packageJson] = await Promise.all([
const [latestVersion, packageJson, storybookVersion] = await Promise.all([
//
packageManager.latestVersion('@storybook/cli'),
packageManager.retrievePackageJson(),
getCoercedStorybookVersion(packageManager),
]);

const isOutdated = lt(currentVersion, latestVersion);
Expand Down Expand Up @@ -188,7 +190,7 @@ export const doUpgrade = async ({
const mainConfig = await loadMainConfig({ configDir });

// GUARDS
if (!beforeVersion) {
if (!storybookVersion) {
throw new UpgradeStorybookUnknownCurrentVersionError();
}

Expand Down

0 comments on commit 7750f00

Please sign in to comment.