From c11285e98529c105de198b7bc57cb8480939f55f Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 25 Oct 2026 13:03:35 -0500 Subject: [PATCH] exit code retry --- packages/scripts/src/downloadClient/index.ts | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/scripts/src/downloadClient/index.ts b/packages/scripts/src/downloadClient/index.ts index af9ac8a94..c9eb68b61 100644 --- a/packages/scripts/src/downloadClient/index.ts +++ b/packages/scripts/src/downloadClient/index.ts @@ -46,24 +46,25 @@ if (provider === "steam") { const password = assertSecret(import.meta.env.STEAM_PASSWORD); while (true) { - try { - await $`${DEPOT_DOWNLOADER_EXECUTABLE} -os ${ - platform - } -app ${id} -username ${username} -password ${ - password - } -dir ${dir} -max-downloads ${DEPOT_DOWNLOADER_MAX_DOWNLOADS}`; + const result = await $`${ + DEPOT_DOWNLOADER_EXECUTABLE + } -os ${platform} -app ${id} -username ${ + username + } -password ${password} -dir ${dir} -max-downloads ${ + DEPOT_DOWNLOADER_MAX_DOWNLOADS + }`.nothrow(); + if (result.exitCode === 0) { console.log("Client downloaded successfully!"); break; - } catch { - console.error( - `DepotDownloader failed. Retrying in ${DEPOT_DOWNLOADER_RETRY_TIME / 1000} seconds...`, - ); - - await new Promise((resolve) => - setTimeout(resolve, DEPOT_DOWNLOADER_RETRY_TIME), - ); } + + console.error( + `DepotDownloader failed (exit ${result.exitCode}). Retrying in ${DEPOT_DOWNLOADER_RETRY_TIME / 1000} seconds...`, + ); + await new Promise((resolve) => + setTimeout(resolve, DEPOT_DOWNLOADER_RETRY_TIME), + ); } } else if (provider === "zip") { const url = assertSecret(import.meta.env.CLIENT_SOURCE);