Skip to content

Commit 019a6f8

Browse files
committedOct 22, 2024··
fix(upgrade): avoid printing info when versions are unknown
1 parent 40877ae commit 019a6f8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

‎playground/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"nuxi": "node ../bin/nuxi.mjs"
88
},
99
"dependencies": {
10-
"nuxt": "latest"
10+
"nuxt": "npm:nuxt-nightly@4.0.0-28826691.eaeda4ee"
1111
}
1212
}

‎src/commands/upgrade.ts

+7
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ export default defineCommand({
172172
const upgradedVersion = (await getNuxtVersion(cwd)) || '[unknown]'
173173
consola.info('Upgraded Nuxt version:', upgradedVersion)
174174

175+
if (upgradedVersion === '[unknown]') {
176+
return
177+
}
178+
175179
if (upgradedVersion === currentVersion) {
176180
consola.success('You\'re already using the latest version of Nuxt.')
177181
}
@@ -182,6 +186,9 @@ export default defineCommand({
182186
'to',
183187
upgradedVersion,
184188
)
189+
if (currentVersion === '[unknown]') {
190+
return
191+
}
185192
const commitA = nuxtVersionToGitIdentifier(currentVersion)
186193
const commitB = nuxtVersionToGitIdentifier(upgradedVersion)
187194
if (commitA && commitB) {

0 commit comments

Comments
 (0)
Please sign in to comment.