Ease consumption (#125)

69fb25b · Paulo F. Oliveira · 2022-08-01 12:23

4 files +6 -6
Message
{commit_body(@commit)}

Files changed

modified dist/index.js
+3 −3
@@ -6191,12 +6191,12 @@ async function maybeInstallRebar3(rebar3Spec) {
6191 6191
6192 6192 async function getOTPVersion(otpSpec0, osVersion) {
6193 6193 const otpVersions = await getOTPVersions(osVersion)
6194 const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
6194 + const otpSpec = otpSpec0.match(/^(OTP-|maint-)?([^ ]+)/)
6195 6195 let otpVersion
6196 6196 if (otpSpec[1] && !isStrictVersion()) {
6197 6197 throw new Error(
6198 6198 `Requested Erlang/OTP version (${otpSpec0}) ` +
6199 "should not contain 'OTP-'",
6199 + "should not contain 'OTP-, or maint-'",
6200 6200 )
6201 6201 }
6202 6202 if (otpSpec) {
@@ -6310,7 +6310,7 @@ async function getOTPVersions(osVersion) {
6310 6310 .trim()
6311 6311 .split('\n')
6312 6312 .forEach((line) => {
6313 const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
6313 + const otpMatch = line.match(/^(OTP-|maint-)?([^ ]+)/)
6314 6314 const otpVersion = otpMatch[2]
6315 6315 otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
6316 6316 })
modified src/setup-beam.js
+3 −3
@@ -139,12 +139,12 @@ async function maybeInstallRebar3(rebar3Spec) {
139 139
140 140 async function getOTPVersion(otpSpec0, osVersion) {
141 141 const otpVersions = await getOTPVersions(osVersion)
142 const otpSpec = otpSpec0.match(/^(OTP-)?([^ ]+)/)
142 + const otpSpec = otpSpec0.match(/^(OTP-|maint-)?([^ ]+)/)
143 143 let otpVersion
144 144 if (otpSpec[1] && !isStrictVersion()) {
145 145 throw new Error(
146 146 `Requested Erlang/OTP version (${otpSpec0}) ` +
147 "should not contain 'OTP-'",
147 + "should not contain 'OTP-, or maint-'",
148 148 )
149 149 }
150 150 if (otpSpec) {
@@ -258,7 +258,7 @@ async function getOTPVersions(osVersion) {
258 258 .trim()
259 259 .split('\n')
260 260 .forEach((line) => {
261 const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
261 + const otpMatch = line.match(/^(OTP-|maint-)?([^ ]+)/)
262 262 const otpVersion = otpMatch[2]
263 263 otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
264 264 })

Parents: caa49b0