From 7750f006c4c0ff11622c37cdb44449cca4ad3985 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 20 Feb 2024 16:47:15 +0100 Subject: [PATCH] Fix --- code/lib/cli/src/upgrade.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/lib/cli/src/upgrade.ts b/code/lib/cli/src/upgrade.ts index f0b7cc5ff612..bb07d053d5d4 100644 --- a/code/lib/cli/src/upgrade.ts +++ b/code/lib/cli/src/upgrade.ts @@ -19,6 +19,7 @@ import { getStorybookInfo, loadMainConfig, JsPackageManagerFactory, + getCoercedStorybookVersion, } from '@storybook/core-common'; import { automigrate } from './automigrate/index'; import { autoblock } from './autoblock/index'; @@ -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); @@ -188,7 +190,7 @@ export const doUpgrade = async ({ const mainConfig = await loadMainConfig({ configDir }); // GUARDS - if (!beforeVersion) { + if (!storybookVersion) { throw new UpgradeStorybookUnknownCurrentVersionError(); }