mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 07:06:07 +00:00
Don't preprend v when elixir version does not start with digits (#61)
This commit is contained in:
@@ -103,6 +103,9 @@ jobs:
|
|||||||
- elixir-version: '1.10.3'
|
- elixir-version: '1.10.3'
|
||||||
otp-version: '22.3.4.1'
|
otp-version: '22.3.4.1'
|
||||||
os: 'ubuntu-20.04'
|
os: 'ubuntu-20.04'
|
||||||
|
- elixir-version: 'master'
|
||||||
|
otp-version: '23.1'
|
||||||
|
os: 'ubuntu-20.04'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use erlef/setup-beam
|
- name: Use erlef/setup-beam
|
||||||
|
|||||||
@@ -187,6 +187,14 @@ async function testElixirVersions() {
|
|||||||
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
assert.deepStrictEqual(got, expected)
|
assert.deepStrictEqual(got, expected)
|
||||||
simulateInput('version-type', 'loose')
|
simulateInput('version-type', 'loose')
|
||||||
|
|
||||||
|
simulateInput('version-type', 'strict')
|
||||||
|
spec = 'master'
|
||||||
|
otpVersion = '23.1'
|
||||||
|
expected = 'master-otp-23'
|
||||||
|
got = await setupBeam.getElixirVersion(spec, otpVersion)
|
||||||
|
assert.deepStrictEqual(got, expected)
|
||||||
|
simulateInput('version-type', 'loose')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testRebar3Versions() {
|
async function testRebar3Versions() {
|
||||||
|
|||||||
Vendored
+4
-1
@@ -4830,7 +4830,10 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return `v${elixirVersionWithOTP}`
|
const DigitStart = new RegExp('^\\d+')
|
||||||
|
return DigitStart.test(elixirVersion)
|
||||||
|
? `v${elixirVersionWithOTP}`
|
||||||
|
: elixirVersionWithOTP
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRebar3Version(r3Spec) {
|
async function getRebar3Version(r3Spec) {
|
||||||
|
|||||||
+4
-1
@@ -174,7 +174,10 @@ async function getElixirVersion(exSpec0, otpVersion) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return `v${elixirVersionWithOTP}`
|
const DigitStart = new RegExp('^\\d+')
|
||||||
|
return DigitStart.test(elixirVersion)
|
||||||
|
? `v${elixirVersionWithOTP}`
|
||||||
|
: elixirVersionWithOTP
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRebar3Version(r3Spec) {
|
async function getRebar3Version(r3Spec) {
|
||||||
|
|||||||
Reference in New Issue
Block a user