Skip to content

Commit aa3073b

Browse files
Allow chosen OTP version to affect chosen Elixir version (master)
1 parent d4cfdcf commit aa3073b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26086,7 +26086,7 @@ async function getElixirVersion(exSpec0, otpVersion0) {
2608626086
}
2608726087

2608826088
const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] =
26089-
await getElixirVersions()
26089+
await getElixirVersions(otpVersion0)
2609026090
const spec = exSpec0.replace(otpSuffix, '')
2609126091
const versions = elixirVersions
2609226092
const elixirVersionFromSpec = getVersionFromSpec(spec, versions)
@@ -26246,7 +26246,7 @@ async function getOTPVersions(osVersion) {
2624626246
return [otpVersions, originListing, hexMirrors]
2624726247
}
2624826248

26249-
async function getElixirVersions() {
26249+
async function getElixirVersions(otpVersion0) {
2625026250
const originListing = '/builds/elixir/builds.txt'
2625126251
const hexMirrors = hexMirrorsInput()
2625226252
const elixirVersionsListings = await doWithMirrors({
@@ -26265,11 +26265,14 @@ async function getElixirVersions() {
2626526265
.forEach((line) => {
2626626266
const elixirMatch =
2626726267
line.match(/^v?(.+)-otp-([^ ]+)/) || line.match(/^v?([^ ]+)/)
26268-
const elixirVersion = elixirMatch[1]
26268+
let elixirVersion = elixirMatch[1]
2626926269
const otpVersion = elixirMatch[2]
2627026270
const otpVersions = otpVersionsForElixirMap[elixirVersion] || []
2627126271
if (otpVersion) {
2627226272
// -otp- present (special case)
26273+
if (otpVersion0 === 'master') {
26274+
elixirVersion = `${elixirVersion}-otp-${otpVersion}`
26275+
}
2627326276
otpVersions.push(otpVersion)
2627426277
}
2627526278
otpVersionsForElixirMap[elixirVersion] = otpVersions

src/setup-beam.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async function getElixirVersion(exSpec0, otpVersion0) {
211211
}
212212

213213
const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] =
214-
await getElixirVersions()
214+
await getElixirVersions(otpVersion0)
215215
const spec = exSpec0.replace(otpSuffix, '')
216216
const versions = elixirVersions
217217
const elixirVersionFromSpec = getVersionFromSpec(spec, versions)
@@ -371,7 +371,7 @@ async function getOTPVersions(osVersion) {
371371
return [otpVersions, originListing, hexMirrors]
372372
}
373373

374-
async function getElixirVersions() {
374+
async function getElixirVersions(otpVersion0) {
375375
const originListing = '/builds/elixir/builds.txt'
376376
const hexMirrors = hexMirrorsInput()
377377
const elixirVersionsListings = await doWithMirrors({
@@ -390,11 +390,14 @@ async function getElixirVersions() {
390390
.forEach((line) => {
391391
const elixirMatch =
392392
line.match(/^v?(.+)-otp-([^ ]+)/) || line.match(/^v?([^ ]+)/)
393-
const elixirVersion = elixirMatch[1]
393+
let elixirVersion = elixirMatch[1]
394394
const otpVersion = elixirMatch[2]
395395
const otpVersions = otpVersionsForElixirMap[elixirVersion] || []
396396
if (otpVersion) {
397397
// -otp- present (special case)
398+
if (otpVersion0 === 'master') {
399+
elixirVersion = `${elixirVersion}-otp-${otpVersion}`
400+
}
398401
otpVersions.push(otpVersion)
399402
}
400403
otpVersionsForElixirMap[elixirVersion] = otpVersions

0 commit comments

Comments
 (0)