From c99820788884a6054d06c29ed29b5e83dac66caa Mon Sep 17 00:00:00 2001 From: extremeheat Date: Fri, 6 Oct 2023 22:03:12 -0400 Subject: [PATCH] Fix update checking workflow's majorVersion handling Use an if-else statement instead of a try-catch --- .github/helper-bot/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/helper-bot/index.js b/.github/helper-bot/index.js index 8b91863b8..f89449fe3 100644 --- a/.github/helper-bot/index.js +++ b/.github/helper-bot/index.js @@ -121,10 +121,10 @@ async function updateManifestPC () { const versionJson = require('./version.json') let majorVersion - try { + if (versionJson.id && versionJson.id.includes('.')) { majorVersion = versionJson.id.split('.', 2).join('.') - } catch (e) { - console.error('Failed to get major version from version.json.id', versionJson.id, ', falling back to protocolVersions.json latest (may be incorrect)') + } else { + console.error(`Version '${versionJson.id}' appears to be a snapshot (no dot in name). Using the last known majorVersion in protocolVersions.json for this version (may be incorrect)`) majorVersion = protocolVersions.pc[0].majorVersion }