Skip to content

Commit ea233e5

Browse files
committed
fix(cli): replace deprecated rmdir with rm for recursive deletion
Use fs.promises.rm instead of rmdir for recursive directory removal. rmdir no longer accepts the recursive option in modern Node.js.
1 parent 10093d5 commit ea233e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/cli/src/cache/static-cache-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Handles environment-aware static data cache operations
44
*/
55

6-
import { access, mkdir, readdir, readFile, rmdir, stat, writeFile } from "node:fs/promises"
6+
import { access, mkdir, readdir, readFile, rm, stat, writeFile } from "node:fs/promises"
77
import { dirname, join, resolve } from "node:path"
88
import { fileURLToPath } from "node:url"
99

@@ -337,7 +337,7 @@ export class StaticCacheManager {
337337
for (const entityType of typesToClear) {
338338
try {
339339
const entityDir = join(this.config.basePath, entityType)
340-
await rmdir(entityDir, { recursive: true })
340+
await rm(entityDir, { recursive: true, force: true })
341341
logger.debug(LOG_CONTEXT, `Cleared cache for ${entityType}`)
342342
} catch (error) {
343343
if (error instanceof Error && "code" in error && error.code === "ENOENT") {

0 commit comments

Comments
 (0)