From 00630edd51fabc7672b1f4c913090d1abb912d81 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 20 Apr 2026 17:34:19 +0000 Subject: [PATCH] Revert "fix(build): retry dist cleanup to avoid intermittent ENOTEMPTY in CI" This reverts commit a2576ad24d854fe8becc52193766fcba6aaca7b1. --- src/esbuild.mjs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/esbuild.mjs b/src/esbuild.mjs index 6089ac3306..aabacfcee9 100644 --- a/src/esbuild.mjs +++ b/src/esbuild.mjs @@ -10,24 +10,6 @@ import { copyPaths, copyWasms, copyLocales, setupLocaleWatcher } from "@roo-code const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) -async function removeDirWithRetries(dirPath, retries = 5, retryDelayMs = 200) { - for (let attempt = 0; attempt <= retries; attempt++) { - try { - await fs.promises.rm(dirPath, { recursive: true, force: true }) - return - } catch (error) { - const isRetryable = error?.code === "ENOTEMPTY" || error?.code === "EBUSY" || error?.code === "EPERM" - const isLastAttempt = attempt === retries - - if (!isRetryable || isLastAttempt) { - throw error - } - - await new Promise((resolve) => globalThis.setTimeout(resolve, retryDelayMs * (attempt + 1))) - } - } -} - async function main() { const name = "extension" const production = process.argv.includes("--production") @@ -54,7 +36,7 @@ async function main() { if (fs.existsSync(distDir)) { console.log(`[${name}] Cleaning dist directory: ${distDir}`) - await removeDirWithRetries(distDir) + fs.rmSync(distDir, { recursive: true, force: true }) } /**