mirror of
https://github.com/catdevnull/transicion-desordenada-diablo
synced 2024-11-15 02:21:39 +00:00
fix(downloader): crear carpeta antes de intentar escribir
This commit is contained in:
parent
264a7f2adf
commit
3541fc5234
1 changed files with 1 additions and 2 deletions
|
@ -98,9 +98,8 @@ async function downloadFromData(jsonUrl) {
|
||||||
const jsonRes = await fetch(jsonUrl);
|
const jsonRes = await fetch(jsonUrl);
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
const parsed = /** @type {{ dataset: Dataset[] }} */(await jsonRes.json())
|
const parsed = /** @type {{ dataset: Dataset[] }} */(await jsonRes.json())
|
||||||
await writeFile(join(outputPath, "data.json"), JSON.stringify(parsed));
|
|
||||||
|
|
||||||
await mkdir(outputPath, { recursive: true });
|
await mkdir(outputPath, { recursive: true });
|
||||||
|
await writeFile(join(outputPath, "data.json"), JSON.stringify(parsed));
|
||||||
await writeFile(join(outputPath, "url.txt"), jsonUrl);
|
await writeFile(join(outputPath, "url.txt"), jsonUrl);
|
||||||
const errorFile = (
|
const errorFile = (
|
||||||
await open(join(outputPath, "errors.jsonl"), "w")
|
await open(join(outputPath, "errors.jsonl"), "w")
|
||||||
|
|
Loading…
Reference in a new issue