fix: Skip opencode upgrade if same version (#720)

This commit is contained in:
Liang-Shih Lin 2025-07-07 11:36:59 +08:00 committed by GitHub
parent f4c453155d
commit 2446483df5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,6 +35,15 @@ export const UpgradeCommand = {
}
prompts.log.info("Using method: " + method)
const target = args.target ?? (await Installation.latest())
if (Installation.VERSION === target) {
prompts.log.warn(
`opencode upgrade skipped: ${target} is already installed`,
)
prompts.outro("Done")
return
}
prompts.log.info(`From ${Installation.VERSION}${target}`)
const spinner = prompts.spinner()
spinner.start("Upgrading...")