mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-03 08:24:10 -07:00
fix(cli): uninstall extensions using their source URL (#8692)
Co-authored-by: Taneja Hriday <hridayt@google.com>
This commit is contained in:
@@ -573,17 +573,20 @@ export async function loadExtensionConfig(
|
||||
}
|
||||
|
||||
export async function uninstallExtension(
|
||||
extensionName: string,
|
||||
extensionIdentifier: string,
|
||||
cwd: string = process.cwd(),
|
||||
): Promise<void> {
|
||||
const logger = getClearcutLogger(cwd);
|
||||
const installedExtensions = loadUserExtensions();
|
||||
if (
|
||||
!installedExtensions.some(
|
||||
(installed) => installed.config.name === extensionName,
|
||||
)
|
||||
) {
|
||||
throw new Error(`Extension "${extensionName}" not found.`);
|
||||
const extensionName = installedExtensions.find(
|
||||
(installed) =>
|
||||
installed.config.name.toLowerCase() ===
|
||||
extensionIdentifier.toLowerCase() ||
|
||||
installed.installMetadata?.source.toLowerCase() ===
|
||||
extensionIdentifier.toLowerCase(),
|
||||
)?.config.name;
|
||||
if (!extensionName) {
|
||||
throw new Error(`Extension not found.`);
|
||||
}
|
||||
const manager = new ExtensionEnablementManager(
|
||||
ExtensionStorage.getUserExtensionsDir(),
|
||||
|
||||
Reference in New Issue
Block a user