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