mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-22 22:56:07 +00:00
Ease consumption (#125)
Don't take `maint-` -prefixed versions into account unless they're asked for it specifically At the same time, while fetching versions, make sure we identify them better so that 25 does not end up pulling maint-25 instead of OTP-25.0, as it should
This commit is contained in:
committed by
GitHub
parent
caa49b0658
commit
69fb25ba7e
Vendored
+3
-3
@@ -6191,12 +6191,12 @@ async function maybeInstallRebar3(rebar3Spec) {
|
|||||||
|
|
||||||
async function getOTPVersion(otpSpec0, osVersion) {
|
async function getOTPVersion(otpSpec0, osVersion) {
|
||||||
const otpVersions = await getOTPVersions(osVersion)
|
const otpVersions = await getOTPVersions(osVersion)
|
||||||
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
|
const otpSpec = otpSpec0.match(/^(OTP-|maint-)?([^ ]+)/)
|
||||||
let otpVersion
|
let otpVersion
|
||||||
if (otpSpec[1] && !isStrictVersion()) {
|
if (otpSpec[1] && !isStrictVersion()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
||||||
"should not contain 'OTP-'",
|
"should not contain 'OTP-, or maint-'",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (otpSpec) {
|
if (otpSpec) {
|
||||||
@@ -6310,7 +6310,7 @@ async function getOTPVersions(osVersion) {
|
|||||||
.trim()
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
|
const otpMatch = line.match(/^(OTP-|maint-)?([^ ]+)/)
|
||||||
const otpVersion = otpMatch[2]
|
const otpVersion = otpMatch[2]
|
||||||
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
||||||
})
|
})
|
||||||
|
|||||||
+3
-3
@@ -139,12 +139,12 @@ async function maybeInstallRebar3(rebar3Spec) {
|
|||||||
|
|
||||||
async function getOTPVersion(otpSpec0, osVersion) {
|
async function getOTPVersion(otpSpec0, osVersion) {
|
||||||
const otpVersions = await getOTPVersions(osVersion)
|
const otpVersions = await getOTPVersions(osVersion)
|
||||||
const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
|
const otpSpec = otpSpec0.match(/^(OTP-|maint-)?([^ ]+)/)
|
||||||
let otpVersion
|
let otpVersion
|
||||||
if (otpSpec[1] && !isStrictVersion()) {
|
if (otpSpec[1] && !isStrictVersion()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
`Requested Erlang/OTP version (${otpSpec0}) ` +
|
||||||
"should not contain 'OTP-'",
|
"should not contain 'OTP-, or maint-'",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (otpSpec) {
|
if (otpSpec) {
|
||||||
@@ -258,7 +258,7 @@ async function getOTPVersions(osVersion) {
|
|||||||
.trim()
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.forEach((line) => {
|
.forEach((line) => {
|
||||||
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
|
const otpMatch = line.match(/^(OTP-|maint-)?([^ ]+)/)
|
||||||
const otpVersion = otpMatch[2]
|
const otpVersion = otpMatch[2]
|
||||||
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user