mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
fix(core): handle EISDIR in robustRealpath on Windows (#21984)
This commit is contained in:
@@ -384,7 +384,12 @@ function robustRealpath(p: string, visited = new Set<string>()): string {
|
||||
try {
|
||||
return fs.realpathSync(p);
|
||||
} catch (e: unknown) {
|
||||
if (e && typeof e === 'object' && 'code' in e && e.code === 'ENOENT') {
|
||||
if (
|
||||
e &&
|
||||
typeof e === 'object' &&
|
||||
'code' in e &&
|
||||
(e.code === 'ENOENT' || e.code === 'EISDIR')
|
||||
) {
|
||||
try {
|
||||
const stat = fs.lstatSync(p);
|
||||
if (stat.isSymbolicLink()) {
|
||||
@@ -400,7 +405,7 @@ function robustRealpath(p: string, visited = new Set<string>()): string {
|
||||
lstatError &&
|
||||
typeof lstatError === 'object' &&
|
||||
'code' in lstatError &&
|
||||
lstatError.code === 'ENOENT'
|
||||
(lstatError.code === 'ENOENT' || lstatError.code === 'EISDIR')
|
||||
)
|
||||
) {
|
||||
throw lstatError;
|
||||
|
||||
Reference in New Issue
Block a user