From ab2faf28ea6c28e48cbd1b5188702c8fbe8334b0 Mon Sep 17 00:00:00 2001 From: wangjingshuiku Date: Fri, 28 Aug 2026 01:52:52 +0800 Subject: [PATCH] fix(scripts): await release asset downloads Signed-off-by: wangjingshuiku --- scripts/download-binaries-from-release-draft.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/download-binaries-from-release-draft.js b/scripts/download-binaries-from-release-draft.js index c85952a28f..f03c22a936 100644 --- a/scripts/download-binaries-from-release-draft.js +++ b/scripts/download-binaries-from-release-draft.js @@ -25,7 +25,7 @@ const download = async (directory) => { .then((res) => res.json()) .then((res) => res.map(({ name, url }) => ({ name, url }))) - assetList.forEach(async ({ name, url }) => { + await Promise.all(assetList.map(async ({ name, url }) => { const path = `${directory}/${name}` await pipeline( @@ -43,7 +43,7 @@ const download = async (directory) => { createWriteStream(path) ) - }) + })) } if (process.argv.length < 3) { @@ -54,4 +54,7 @@ if (process.argv.length < 3) { const directory = process.argv[2] -download(directory) +download(directory).catch((error) => { + console.error(error) + process.exitCode = 1 +})