Skip to content

Commit

Permalink
Fix update checking workflow's majorVersion handling
Browse files Browse the repository at this point in the history
Use an if-else statement instead of a try-catch
  • Loading branch information
extremeheat committed Oct 7, 2023
1 parent 0dca7fe commit c998207
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/helper-bot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c998207

Please sign in to comment.