From 89519746335a27622daf1066bc4ddfae2359efbe Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sat, 7 May 2022 19:44:07 -0700 Subject: [PATCH] fallback build URL --- resources/index.html | 1 + resources/js/gcdownloader.js | 7 ++++++- resources/js/index.js | 2 -- resources/js/init.js | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 resources/js/init.js diff --git a/resources/index.html b/resources/index.html index a982044..44e7f19 100644 --- a/resources/index.html +++ b/resources/index.html @@ -4,6 +4,7 @@ + diff --git a/resources/js/gcdownloader.js b/resources/js/gcdownloader.js index d28b732..7436c05 100644 --- a/resources/js/gcdownloader.js +++ b/resources/js/gcdownloader.js @@ -56,7 +56,12 @@ async function downloadGC(branch) { const keystoreUrl = `https://github.com/Grasscutters/Grasscutter/raw/${branch}/keystore.p12` // External service that allows un-authed artifact downloading - const artiUrl = `https://nightly.link/Grasscutters/Grasscutter/workflows/build/${branch}/Grasscutter.zip` + let artiUrl = `https://nightly.link/Grasscutters/Grasscutter/workflows/build/${branch}/Grasscutter.zip` + + await axios.get(artiUrl).catch(e => { + // Fallback link if artifacts are not being uploaded + artiUrl = 'https://nightly.link/Grasscutters/Grasscutter/actions/runs/2284467925/Grasscutter.zip' + }) // For data files const dataFiles = await axios.get(`https://api.github.com/repos/Grasscutters/Grasscutter/contents/data?ref=${branch}`) diff --git a/resources/js/index.js b/resources/js/index.js index 4c77c6c..0863998 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -1,5 +1,3 @@ -Neutralino.init() - NL_CWD = NL_CWD.replace(/\//g, '\\') let localeObj diff --git a/resources/js/init.js b/resources/js/init.js new file mode 100644 index 0000000..e85112c --- /dev/null +++ b/resources/js/init.js @@ -0,0 +1,2 @@ +// This file is the very first loaded when the app is started. +Neutralino.init() \ No newline at end of file