mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-09 16:36:40 -07:00
fix(cli): use os.homedir() for home directory warning check (#25890)
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
*/
|
||||
|
||||
import fs from 'node:fs/promises';
|
||||
import { homedir as osHomedir } from 'node:os';
|
||||
import path from 'node:path';
|
||||
import process from 'node:process';
|
||||
import {
|
||||
homedir,
|
||||
getCompatibilityWarnings,
|
||||
WarningPriority,
|
||||
type StartupWarning,
|
||||
@@ -39,10 +39,10 @@ const homeDirectoryCheck: WarningCheck = {
|
||||
try {
|
||||
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
||||
fs.realpath(workspaceRoot),
|
||||
fs.realpath(homedir()),
|
||||
fs.realpath(osHomedir()),
|
||||
]);
|
||||
|
||||
if (workspaceRealPath === homeRealPath) {
|
||||
if (path.resolve(workspaceRealPath) === path.resolve(homeRealPath)) {
|
||||
// If folder trust is enabled and the user trusts the home directory, don't show the warning.
|
||||
if (
|
||||
isFolderTrustEnabled(settings) &&
|
||||
|
||||
Reference in New Issue
Block a user