Skip to content

Commit 0851909

Browse files
committed
fix(cli): narrow completion readlink failures
1 parent 5436a1e commit 0851909

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/cli/completion-runtime.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ async function resolveCompletionProfileWritePath(profilePath: string): Promise<s
285285
throw error;
286286
}
287287
}
288-
const linkTarget = await fs.readlink(profilePath).catch((error: NodeJS.ErrnoException) => {
289-
if (error.code === "ENOENT" || error.code === "EINVAL") {
288+
const linkTarget = await fs.readlink(profilePath).catch((error: unknown) => {
289+
const code = (error as NodeJS.ErrnoException).code;
290+
if (code === "ENOENT" || code === "EINVAL") {
290291
return undefined;
291292
}
292293
throw error;

0 commit comments

Comments
 (0)