Skip to content

Commit

Permalink
fix: do not remove outputDir directory when overwriting is enabled (
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogobbosouza authored Mar 14, 2024
1 parent a72573b commit 9179e66
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/downloader.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -78,10 +78,6 @@ export class Downloader extends Hookable<DownloaderHooks> {
overwriting = true
}

if (overwriting) {
rmSync(outputDir, { recursive: true, force: true })
}

await this.callHook('download:start')

const { searchParams } = new URL(this.url)
Expand Down

0 comments on commit 9179e66

Please sign in to comment.