mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 21:44:25 -07:00
Unused error variables in catch block are not allowed (#24487)
This commit is contained in:
@@ -148,7 +148,7 @@ export function buildSeatbeltProfile(options: SeatbeltArgsOptions): string {
|
||||
addedPaths.add(resolved);
|
||||
profile += `(allow file-read* (subpath "${escapeSchemeString(resolved)}"))\n`;
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// Ignore paths that do not exist or are inaccessible
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,15 @@ export function isErrnoException(e: unknown): e is NodeJS.ErrnoException {
|
||||
export function tryRealpath(p: string): string {
|
||||
try {
|
||||
return fs.realpathSync(p);
|
||||
} catch (_e) {
|
||||
if (isErrnoException(_e) && _e.code === 'ENOENT') {
|
||||
} catch (e) {
|
||||
if (isErrnoException(e) && e.code === 'ENOENT') {
|
||||
const parentDir = path.dirname(p);
|
||||
if (parentDir === p) {
|
||||
return p;
|
||||
}
|
||||
return path.join(tryRealpath(parentDir), path.basename(p));
|
||||
}
|
||||
throw _e;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export function resolveGitWorktreePaths(workspacePath: string): {
|
||||
if (tryRealpath(backlink) === tryRealpath(gitPath)) {
|
||||
isValid = true;
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// Fallback for submodules: check core.worktree in config
|
||||
try {
|
||||
const configPath = path.join(resolvedWorktreeGitDir, 'config');
|
||||
@@ -67,7 +67,7 @@ export function resolveGitWorktreePaths(workspacePath: string): {
|
||||
isValid = true;
|
||||
}
|
||||
}
|
||||
} catch (_e2) {
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ export function resolveGitWorktreePaths(workspacePath: string): {
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// Ignore if .git doesn't exist, isn't readable, etc.
|
||||
}
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user