fix(tui): don't check for version upgrades if it's disabled by the user (#20089)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
co-authored by
Aiden Cline
parent
c9fb8d0ce7
commit
cd6415f332
@@ -7,6 +7,7 @@ import { InstallationVersion } from "@/installation/version"
|
|||||||
|
|
||||||
export async function upgrade() {
|
export async function upgrade() {
|
||||||
const config = await AppRuntime.runPromise(Config.Service.use((cfg) => cfg.getGlobal()))
|
const config = await AppRuntime.runPromise(Config.Service.use((cfg) => cfg.getGlobal()))
|
||||||
|
if (config.autoupdate === false || Flag.OPENCODE_DISABLE_AUTOUPDATE) return
|
||||||
const method = await AppRuntime.runPromise(Installation.Service.use((svc) => svc.method()))
|
const method = await AppRuntime.runPromise(Installation.Service.use((svc) => svc.method()))
|
||||||
const latest = await AppRuntime.runPromise(Installation.Service.use((svc) => svc.latest(method))).catch(() => {})
|
const latest = await AppRuntime.runPromise(Installation.Service.use((svc) => svc.latest(method))).catch(() => {})
|
||||||
if (!latest) return
|
if (!latest) return
|
||||||
@@ -17,7 +18,6 @@ export async function upgrade() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (InstallationVersion === latest) return
|
if (InstallationVersion === latest) return
|
||||||
if (config.autoupdate === false || Flag.OPENCODE_DISABLE_AUTOUPDATE) return
|
|
||||||
|
|
||||||
const kind = Installation.getReleaseType(InstallationVersion, latest)
|
const kind = Installation.getReleaseType(InstallationVersion, latest)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user