fix: Skip opencode upgrade if same version

This commit is contained in:
Liang-Shih Lin 2025-07-06 09:24:27 +08:00
parent ea6bfef21a
commit 703d2f1bf0

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...")