Skip to content

Commit

Permalink
Fix: mkdir before downloading DATs (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm committed Jul 3, 2024
1 parent f6335a6 commit e50eee0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/types/files/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ export default class File implements FileProps {
return this;
}

const fileDir = path.dirname(filePath);
if (!await fsPoly.exists(fileDir)) {
await fsPoly.mkdir(fileDir, { recursive: true });
}

return new Promise((resolve, reject) => {
https.get(this.getFilePath(), {
timeout: 30_000,
Expand Down

0 comments on commit e50eee0

Please sign in to comment.