mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 23:14:32 -07:00
Pass whole extensions rather than just context files (#10910)
Co-authored-by: Jake Macdonald <jakemac@google.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import { type CommandModule } from 'yargs';
|
||||
import { disableExtension } from '../../config/extension.js';
|
||||
import { SettingScope } from '../../config/settings.js';
|
||||
import { getErrorMessage } from '../../utils/errors.js';
|
||||
import { ExtensionEnablementManager } from '../../config/extensions/extensionEnablement.js';
|
||||
import { debugLogger } from '@google/gemini-cli-core';
|
||||
|
||||
interface DisableArgs {
|
||||
@@ -16,11 +17,20 @@ interface DisableArgs {
|
||||
}
|
||||
|
||||
export function handleDisable(args: DisableArgs) {
|
||||
const extensionEnablementManager = new ExtensionEnablementManager();
|
||||
try {
|
||||
if (args.scope?.toLowerCase() === 'workspace') {
|
||||
disableExtension(args.name, SettingScope.Workspace);
|
||||
disableExtension(
|
||||
args.name,
|
||||
SettingScope.Workspace,
|
||||
extensionEnablementManager,
|
||||
);
|
||||
} else {
|
||||
disableExtension(args.name, SettingScope.User);
|
||||
disableExtension(
|
||||
args.name,
|
||||
SettingScope.User,
|
||||
extensionEnablementManager,
|
||||
);
|
||||
}
|
||||
debugLogger.log(
|
||||
`Extension "${args.name}" successfully disabled for scope "${args.scope}".`,
|
||||
@@ -41,7 +51,7 @@ export const disableCommand: CommandModule = {
|
||||
type: 'string',
|
||||
})
|
||||
.option('scope', {
|
||||
describe: 'The scope to disable the extenison in.',
|
||||
describe: 'The scope to disable the extension in.',
|
||||
type: 'string',
|
||||
default: SettingScope.User,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user