From c99a3d5a7514c2b7b0b2f5fc2c53f6315dad6024 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Tue, 6 Jun 2023 15:26:39 +0800 Subject: [PATCH] CLI: Fix upgrade notification message --- code/lib/core-server/src/utils/update-check.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/lib/core-server/src/utils/update-check.ts b/code/lib/core-server/src/utils/update-check.ts index f4c463d2e344..2012921921a0 100644 --- a/code/lib/core-server/src/utils/update-check.ts +++ b/code/lib/core-server/src/utils/update-check.ts @@ -37,8 +37,9 @@ export function createUpdateMessage(updateInfo: VersionCheck, version: string): let updateMessage; try { - const suffix = semver.prerelease(updateInfo.data.latest.version) ? '--prerelease' : ''; - const upgradeCommand = `npx storybook@latest upgrade ${suffix}`.trim(); + const isPrerelease = semver.prerelease(updateInfo.data.latest.version); + const suffix = isPrerelease ? '@next upgrade --prerelease' : '@latest upgrade'; + const upgradeCommand = `npx storybook${suffix}`; updateMessage = updateInfo.success && semver.lt(version, updateInfo.data.latest.version) ? dedent`