From 9179e665c727b70654c7d53765594d2aa2038180 Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Thu, 14 Mar 2024 13:56:40 -0300 Subject: [PATCH] fix: do not remove `outputDir` directory when `overwriting` is enabled (#65) --- src/downloader.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/downloader.ts b/src/downloader.ts index 45112a1..1cfee34 100644 --- a/src/downloader.ts +++ b/src/downloader.ts @@ -1,4 +1,4 @@ -import { existsSync, readFileSync, mkdirSync, writeFileSync, rmSync } from 'node:fs' +import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs' import { extname, posix, resolve, dirname } from 'node:path' import { ofetch } from 'ofetch' import { Hookable } from 'hookable' @@ -78,10 +78,6 @@ export class Downloader extends Hookable { overwriting = true } - if (overwriting) { - rmSync(outputDir, { recursive: true, force: true }) - } - await this.callHook('download:start') const { searchParams } = new URL(this.url)