Skip to content

Commit

Permalink
misc(next-codemod): inform user whether current version is higher or …
Browse files Browse the repository at this point in the history
…on target version (#71160)

"is already on or higher than" is sloppy. Inform correctly to the user.
  • Loading branch information
devjiwonchoi authored Oct 11, 2024
1 parent 1bc31e7 commit ce98a9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/next-codemod/bin/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ export async function runUpgrade(

const targetNextVersion = targetNextPackageJson.version

if (compareVersions(installedNextVersion, targetNextVersion) >= 0) {
if (compareVersions(installedNextVersion, targetNextVersion) === 0) {
console.log(
`${pc.green('✓')} Current Next.js version is already on or higher than the target version "v${targetNextVersion}".`
`${pc.green('✓')} Current Next.js version is already on the target version "v${targetNextVersion}".`
)
return
}
if (compareVersions(installedNextVersion, targetNextVersion) > 0) {
console.log(
`${pc.green('✓')} Current Next.js version is higher than the target version "v${targetNextVersion}".`
)
return
}
Expand Down

0 comments on commit ce98a9a

Please sign in to comment.