From 3541fc5234f12e077f36c1c4a774d6c18ad00144 Mon Sep 17 00:00:00 2001 From: Nulo Date: Fri, 8 Dec 2023 16:25:16 -0300 Subject: [PATCH] fix(downloader): crear carpeta antes de intentar escribir --- downloader/download_json.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/downloader/download_json.js b/downloader/download_json.js index 8f6a2f5..5661bdf 100644 --- a/downloader/download_json.js +++ b/downloader/download_json.js @@ -98,9 +98,8 @@ async function downloadFromData(jsonUrl) { const jsonRes = await fetch(jsonUrl); // prettier-ignore const parsed = /** @type {{ dataset: Dataset[] }} */(await jsonRes.json()) - await writeFile(join(outputPath, "data.json"), JSON.stringify(parsed)); - await mkdir(outputPath, { recursive: true }); + await writeFile(join(outputPath, "data.json"), JSON.stringify(parsed)); await writeFile(join(outputPath, "url.txt"), jsonUrl); const errorFile = ( await open(join(outputPath, "errors.jsonl"), "w")