Skip to content

Commit c1511f6

Browse files
Merge pull request #7547 from Shopify/fonso/friendlier-autoupgrade-message
Friendlier auto-upgrade messaging (version range + success banner)
2 parents 5cc741d + 4075549 commit c1511f6

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/cli-kit/src/public/node/upgrade.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
getPackageManager,
1313
} from './node-package-manager.js'
1414
import {outputContent, outputDebug, outputInfo, outputToken, outputWarn} from './output.js'
15+
import {renderSuccess} from './ui.js'
1516
import {cwd, moduleDirectory, sniffForPath} from './path.js'
1617
import {exec, isCI} from './system.js'
1718
import {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

Comments
 (0)