From d5fd3dcaf2430170a92f12db47faebcf614f1dde Mon Sep 17 00:00:00 2001 From: GHOST Date: Tue, 17 Sep 2024 02:32:37 +0100 Subject: [PATCH] fix: only log cleaning up if actually cleaning up --- .changeset/hungry-cobras-glow.md | 5 +++++ src/emit.ts | 1 + src/utils/temp.ts | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/hungry-cobras-glow.md diff --git a/.changeset/hungry-cobras-glow.md b/.changeset/hungry-cobras-glow.md new file mode 100644 index 0000000..f485560 --- /dev/null +++ b/.changeset/hungry-cobras-glow.md @@ -0,0 +1,5 @@ +--- +'extractinator': patch +--- + +fix: only log cleaning up in temp if actaully cleaning up diff --git a/src/emit.ts b/src/emit.ts index 26317d0..d73f313 100644 --- a/src/emit.ts +++ b/src/emit.ts @@ -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 }) }, diff --git a/src/utils/temp.ts b/src/utils/temp.ts index 30e20de..6b9b1f2 100644 --- a/src/utils/temp.ts +++ b/src/utils/temp.ts @@ -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 }) } }