Ensure an engine-only ruby-version picks the latest stable version and not a preview or RC

This commit is contained in:
Benoit Daloze
2020-11-18 21:52:51 +01:00
parent 34fbbc1d36
commit 7c2bf7263d
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
let version = parsedVersion
if (!engineVersions.includes(parsedVersion)) {
const latestToFirstVersion = engineVersions.slice().reverse()
const found = latestToFirstVersion.find(v => !common.isHeadVersion(v) && v.startsWith(parsedVersion))
const found = latestToFirstVersion.find(v => common.isStableVersion(v) && v.startsWith(parsedVersion))
if (found) {
version = found
} else {