瀏覽代碼

Actually... (simplification).

Herby Vojčík 5 年之前
父節點
當前提交
81f3ddf4d0
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      index.js

+ 1 - 5
index.js

@@ -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);
     }