From 076610ec754c3880fddbd5e7a6ca26bf23f69501 Mon Sep 17 00:00:00 2001 From: "Gustavo Costa (Thoughtworks)" Date: Tue, 9 Jun 2026 14:06:53 -0300 Subject: [PATCH] fix: silence EPERM errors when removing temp files EPERM is returned by macOS SIP/TCC for system-owned temp directories (e.g. /var/folders/.../T/com.apple.*). These are expected and not actionable by the user, so treat them like EACCES and skip logging. Fixes #61 --- src/utils/fs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/fs.ts b/src/utils/fs.ts index e48e7ce..1ed081e 100644 --- a/src/utils/fs.ts +++ b/src/utils/fs.ts @@ -270,7 +270,7 @@ export async function removeItem(path: string, dryRun = false): Promise } catch (error) { // Log the error for debugging but don't expose details to potential attackers const code = (error as NodeJS.ErrnoException).code; - if (code !== 'ENOENT' && code !== 'EACCES') { + if (code !== 'ENOENT' && code !== 'EACCES' && code !== 'EPERM') { console.error(`Failed to remove ${path}: ${code || 'unknown error'}`); } return false;