Skip to content

Commit 7c81d37

Browse files
Copilothotlong
andcommitted
fix: add retry logic to fs.rmSync to handle ENOTEMPTY errors
Add maxRetries and retryDelay options to fs.rmSync() call in build-schemas.ts to handle race conditions that can occur during directory cleanup. This fixes the ENOTEMPTY error that was causing CI builds to fail. Resolves: https://github.com/objectstack-ai/spec/actions/runs/21706243682 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9bc8810 commit 7c81d37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/spec/scripts/build-schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const OUT_DIR = path.resolve(__dirname, '../json-schema');
99
// Clean output directory ensures no stale files remain
1010
if (fs.existsSync(OUT_DIR)) {
1111
console.log(`Cleaning output directory: ${OUT_DIR}`);
12-
fs.rmSync(OUT_DIR, { recursive: true, force: true });
12+
fs.rmSync(OUT_DIR, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
1313
}
1414

1515
// Ensure output directory exists

0 commit comments

Comments
 (0)