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
@@ -0,0 +1,36 @@
|
||||
export const resolveOpenCodeUpgradeCapability = ({
|
||||
isExternal,
|
||||
hasManagedProcess,
|
||||
activeBinary,
|
||||
isBundledBinary,
|
||||
}) => {
|
||||
if (isExternal) {
|
||||
return {
|
||||
supported: false,
|
||||
manager: 'external',
|
||||
reason: 'external',
|
||||
};
|
||||
}
|
||||
|
||||
if (!hasManagedProcess || !activeBinary) {
|
||||
return {
|
||||
supported: false,
|
||||
manager: null,
|
||||
reason: 'unavailable',
|
||||
};
|
||||
}
|
||||
|
||||
if (isBundledBinary(activeBinary)) {
|
||||
return {
|
||||
supported: false,
|
||||
manager: 'openchamber',
|
||||
reason: 'bundled',
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
supported: true,
|
||||
manager: 'opencode',
|
||||
reason: null,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user