fix: skip compile cache permission warnings (#76362) (thanks @neeravmakwana)

This commit is contained in:
Ayaan Zaidi
2026-05-05 21:14:32 +05:30
parent 5d03fb2553
commit 77ae06bfaa
3 changed files with 62 additions and 0 deletions

View File

@@ -814,6 +814,10 @@ function shouldRunBundledPluginPostinstall(params) {
return true;
}
function isCompileCachePrunePermissionDenied(error) {
return error?.code === "EACCES" || error?.code === "EPERM";
}
export function pruneOpenClawCompileCache(params = {}) {
const env = params.env ?? process.env;
const pathExists = params.existsSync ?? existsSync;
@@ -842,10 +846,16 @@ export function pruneOpenClawCompileCache(params = {}) {
retryDelay: 100,
});
} catch (error) {
if (isCompileCachePrunePermissionDenied(error)) {
continue;
}
log.warn?.(`[postinstall] could not prune OpenClaw compile cache: ${String(error)}`);
}
}
} catch (error) {
if (isCompileCachePrunePermissionDenied(error)) {
continue;
}
log.warn?.(`[postinstall] could not prune OpenClaw compile cache: ${String(error)}`);
}
}