fix: prevent bundled OpenCode self-upgrades (#2525)
* fix: prevent bundled OpenCode self-upgrades * feat(vscode): support OpenCode upgrades * fix: refresh OpenCode update status on runtime switch --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
c0405d3fa4
commit
c88dd16d2a
@@ -79,6 +79,9 @@ export const resolveOpenCodeUpdateVersion = (detail: unknown): string => {
|
||||
export interface OpenCodeUpgradeStatusLike {
|
||||
readonly available?: boolean | null;
|
||||
readonly latestVersion?: string | null;
|
||||
readonly upgrade?: {
|
||||
readonly supported?: boolean | null;
|
||||
} | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,6 +93,7 @@ export const resolveOpenCodeUpgradeStatusVersion = (
|
||||
status: OpenCodeUpgradeStatusLike | null | undefined,
|
||||
): string => {
|
||||
if (!status) return '';
|
||||
if (status.upgrade?.supported !== true) return '';
|
||||
if (status.available !== true) return '';
|
||||
if (typeof status.latestVersion !== 'string') return '';
|
||||
return status.latestVersion.trim();
|
||||
|
||||
Reference in New Issue
Block a user