mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 01:21:10 -07:00
Simplify extension settings command (#16001)
This commit is contained in:
@@ -309,7 +309,7 @@ Would you like to attempt to install via "git clone" instead?`,
|
||||
.map((s) => s.name)
|
||||
.join(
|
||||
', ',
|
||||
)}. Please run "gemini extensions settings ${newExtensionConfig.name} <setting-name>" to configure them.`;
|
||||
)}. Please run "gemini extensions config ${newExtensionConfig.name} [setting-name]" to configure them.`;
|
||||
debugLogger.warn(message);
|
||||
coreEvents.emitFeedback('warning', message);
|
||||
}
|
||||
|
||||
@@ -266,26 +266,6 @@ describe('extensionUpdates', () => {
|
||||
vi.spyOn(fs.promises, 'writeFile').mockResolvedValue(undefined);
|
||||
vi.spyOn(fs.promises, 'rm').mockResolvedValue(undefined);
|
||||
vi.mocked(fs.existsSync).mockReturnValue(false); // No hooks
|
||||
|
||||
// Mock copyExtension? It's imported.
|
||||
// We can rely on ignoring the failure if we mock enough.
|
||||
// Actually copyExtension is called. We need to mock it if it does real IO.
|
||||
// But we can just let it fail or mock fs.cp if it uses it.
|
||||
// Let's assume the other mocks cover the critical path to the warning.
|
||||
// Warning happens BEFORE copyExtension?
|
||||
// No, warning is after copyExtension usually.
|
||||
// But in my code:
|
||||
// const missingSettings = await getMissingSettings(...)
|
||||
// if (missingSettings.length > 0) debugLogger.warn(...)
|
||||
// ...
|
||||
// copyExtension(...)
|
||||
|
||||
// Wait, let's check extension-manager.ts order.
|
||||
// Line 303: getMissingSettings
|
||||
// Line 317: if (installMetadata.type === 'local' ...) copyExtension
|
||||
|
||||
// So getMissingSettings is called BEFORE copyExtension.
|
||||
|
||||
try {
|
||||
await manager.installOrUpdateExtension(installMetadata, previousConfig);
|
||||
} catch (_) {
|
||||
@@ -300,7 +280,7 @@ describe('extensionUpdates', () => {
|
||||
expect(coreEvents.emitFeedback).toHaveBeenCalledWith(
|
||||
'warning',
|
||||
expect.stringContaining(
|
||||
'Please run "gemini extensions settings test-ext <setting-name>"',
|
||||
'Please run "gemini extensions config test-ext [setting-name]"',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user