From 6d73eaa8fa18a6f5a8fee042974b21bf28f182e4 Mon Sep 17 00:00:00 2001 From: Ricardo Gobbo de Souza Date: Thu, 14 Mar 2024 13:40:28 -0300 Subject: [PATCH] fix: do not remove `outputDir` directory when `overwriting` is enabled --- src/downloader.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/downloader.ts b/src/downloader.ts index 08fd45c..d730b68 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' @@ -77,10 +77,6 @@ export class Downloader extends Hookable { overwriting = true } - if (overwriting) { - rmSync(outputDir, { recursive: true, force: true }) - } - await this.callHook('download:start') // download css content