@@ -12,6 +12,7 @@ import {
1212 getPackageManager ,
1313} from './node-package-manager.js'
1414import { outputContent , outputDebug , outputInfo , outputToken , outputWarn } from './output.js'
15+ import { renderSuccess } from './ui.js'
1516import { cwd , moduleDirectory , sniffForPath } from './path.js'
1617import { exec , isCI } from './system.js'
1718import { isPreReleaseVersion } from './version.js'
@@ -92,8 +93,21 @@ export async function runCLIUpgrade(options: RunCLIUpgradeOptions = {}): Promise
9293 if ( ! command ) {
9394 throw new Error ( 'Could not determine the command to run' )
9495 }
95- outputInfo ( outputContent `Upgrading Shopify CLI by running: ${ outputToken . genericShellCommand ( installCommand ) } ...` )
96+ // Cache lookup — already populated by versionToAutoUpgrade() upstream, so this
97+ // is just a synchronous cache read, no extra network call.
98+ const newerVersion = checkForCachedNewVersion ( '@shopify/cli' , CLI_KIT_VERSION )
99+ const headline = newerVersion
100+ ? `✨ New version of Shopify CLI available! (${ CLI_KIT_VERSION } → ${ newerVersion } )`
101+ : '✨ New version of Shopify CLI available!'
102+ outputInfo (
103+ outputContent `${ headline }
104+ Now upgrading by running: ${ outputToken . genericShellCommand ( installCommand ) } ...` ,
105+ )
96106 await exec ( command , args , { stdio : 'inherit' } )
107+ renderSuccess ( {
108+ headline : 'Shopify CLI upgraded.' ,
109+ body : newerVersion ? `You're now on version ${ newerVersion } .` : "You're now on the latest version." ,
110+ } )
97111 } else if ( projectDir ) {
98112 await upgradeLocalShopify ( projectDir , CLI_KIT_VERSION )
99113 } else {
0 commit comments