Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Nov 27, 2024
1 parent 3892584 commit 05d289a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/plugin-dts/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,22 @@ export async function emptyDir(dir: string): Promise<void> {

try {
for (const file of await fs.promises.readdir(dir)) {
console.log('file: ', file);
await fs.promises.rm(path.resolve(dir, file), {
recursive: true,
force: true,
});
}
} catch (err) {
console.log('err: ', err);
logger.debug(`Failed to empty dir: ${dir}`);
logger.debug(err);
}
}

export async function clearTempDeclarationDir(cwd: string): Promise<void> {
const dirPath = path.join(cwd, TEMP_DTS_DIR);
console.log('dirPath: ', dirPath);

await emptyDir(dirPath);
}
Expand Down

0 comments on commit 05d289a

Please sign in to comment.