mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
fix(cli): skip workspace policy loading when in home directory (#20054)
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
GOOGLE_ACCOUNTS_FILENAME,
|
||||
isSubpath,
|
||||
resolveToRealPath,
|
||||
normalizePath,
|
||||
} from '../utils/paths.js';
|
||||
import { ProjectRegistry } from './projectRegistry.js';
|
||||
import { StorageMigration } from './storageMigration.js';
|
||||
@@ -142,6 +143,17 @@ export class Storage {
|
||||
return path.join(this.targetDir, GEMINI_DIR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current workspace storage location is the same as the global/user storage location.
|
||||
* This handles symlinks and platform-specific path normalization.
|
||||
*/
|
||||
isWorkspaceHomeDir(): boolean {
|
||||
return (
|
||||
normalizePath(resolveToRealPath(this.targetDir)) ===
|
||||
normalizePath(resolveToRealPath(homedir()))
|
||||
);
|
||||
}
|
||||
|
||||
getAgentsDir(): string {
|
||||
return path.join(this.targetDir, AGENTS_DIR_NAME);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user