Skip to content

Commit

Permalink
fix: only log cleaning up if actually cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdevv committed Sep 17, 2024
1 parent 47d9e11 commit d5fd3dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-cobras-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'extractinator': patch
---

fix: only log cleaning up in temp if actaully cleaning up
1 change: 1 addition & 0 deletions src/emit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export async function emit_dts(input_dir: string) {
lv(o('skipping cleanup in debug mode'))
return
}

lv(d('cleaning up dts...'))
await rm(TEMP_DIR, { recursive: true, force: true })
},
Expand Down
3 changes: 1 addition & 2 deletions src/utils/temp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ export async function get_temp_dir(name: string) {
export async function clean_temp() {
const TEMP_ROOT = resolve('.extractinator')

lv(d('cleaning up dts...'))

//? Remove the .extractinator dir if it's empty.
if ((await readdir(TEMP_ROOT)).length == 0) {
lv(d('cleaning up dts...'))
await rm(TEMP_ROOT, { recursive: true, force: true })
}
}

0 comments on commit d5fd3dc

Please sign in to comment.