fix(settings/env): Ensure that loadEnvironment is always called with settings. (#7313)

This commit is contained in:
Richie Foreman
2025-08-28 13:52:25 -04:00
committed by GitHub
parent 600151cc2c
commit dd79e9b84a
3 changed files with 14 additions and 37 deletions
+4 -4
View File
@@ -5,10 +5,10 @@
*/
import { AuthType } from '@google/gemini-cli-core';
import { loadEnvironment } from './settings.js';
import { loadEnvironment, loadSettings } from './settings.js';
export const validateAuthMethod = (authMethod: string): string | null => {
loadEnvironment();
export function validateAuthMethod(authMethod: string): string | null {
loadEnvironment(loadSettings(process.cwd()).merged);
if (
authMethod === AuthType.LOGIN_WITH_GOOGLE ||
authMethod === AuthType.CLOUD_SHELL
@@ -40,4 +40,4 @@ export const validateAuthMethod = (authMethod: string): string | null => {
}
return 'Invalid auth method selected.';
};
}