Skip to content

Commit 1489b9c

Browse files
authored
Fix the error that occurs when the output directory does not exist (#202)
* do not use deprecated API * fix the error that occurs when the output directory does not exist * add changelog
1 parent 5453f5e commit 1489b9c

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/pink-rats-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@css-modules-kit/codegen': patch
3+
---
4+
5+
fix: fix the error that occurs when the output directory does not exist

packages/codegen/src/runner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFile, rmdir } from 'node:fs/promises';
1+
import { readFile, rm } from 'node:fs/promises';
22
import type {
33
CMKConfig,
44
CSSModule,
@@ -121,7 +121,7 @@ export async function runCMK(project: string, clean: boolean, logger: Logger): P
121121
}
122122

123123
if (clean) {
124-
await rmdir(config.dtsOutDir, { recursive: true });
124+
await rm(config.dtsOutDir, { recursive: true, force: true });
125125
}
126126
await Promise.all(
127127
parseResults.map(async (parseResult) =>

0 commit comments

Comments
 (0)