|
@@ -14,7 +14,9 @@ async function work () {
|
|
|
const [, issue, year] = name.match(/(\d+)\/(\d+)/);
|
|
const [, issue, year] = name.match(/(\d+)\/(\d+)/);
|
|
|
console.info(`File ${year} / ${issue}: ${description}`);
|
|
console.info(`File ${year} / ${issue}: ${description}`);
|
|
|
const xmlRaw = await fetch(url);
|
|
const xmlRaw = await fetch(url);
|
|
|
- saves.push(xmlRaw.body.pipe(createWriteStream(`${year}.${issue}.xml`)));
|
|
|
|
|
|
|
+ saves.push((async () => {
|
|
|
|
|
+ await xmlRaw.body.pipe(createWriteStream(`${year}.${issue}.xml`));
|
|
|
|
|
+ })());
|
|
|
}
|
|
}
|
|
|
await Promise.all(saves);
|
|
await Promise.all(saves);
|
|
|
}
|
|
}
|