mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-22 22:56:07 +00:00
Add ref: (version) support to .tool-versions parsing (#228)
* Add support elixir ref in .tool-versions * Make the v in ref:v optional * Revert and refactor test changes * Run build-dist
This commit is contained in:
Vendored
+2
-2
@@ -10418,11 +10418,11 @@ function parseVersionFile(versionFilePath0) {
|
||||
// If we ever start parsing something else, this should
|
||||
// become default in a new option named e.g. version-file-type
|
||||
versions.split('\n').forEach((line) => {
|
||||
const appVersion = line.match(/^([^ ]+)[ ]+([^ #]+)/)
|
||||
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
||||
if (appVersion) {
|
||||
const app = appVersion[1]
|
||||
if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) {
|
||||
const [, , version] = appVersion
|
||||
const [, , , version] = appVersion
|
||||
core.info(`Consuming ${app} at version ${version}`)
|
||||
appVersions.set(app, version)
|
||||
}
|
||||
|
||||
+2
-2
@@ -602,11 +602,11 @@ function parseVersionFile(versionFilePath0) {
|
||||
// If we ever start parsing something else, this should
|
||||
// become default in a new option named e.g. version-file-type
|
||||
versions.split('\n').forEach((line) => {
|
||||
const appVersion = line.match(/^([^ ]+)[ ]+([^ #]+)/)
|
||||
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
|
||||
if (appVersion) {
|
||||
const app = appVersion[1]
|
||||
if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) {
|
||||
const [, , version] = appVersion
|
||||
const [, , , version] = appVersion
|
||||
core.info(`Consuming ${app} at version ${version}`)
|
||||
appVersions.set(app, version)
|
||||
}
|
||||
|
||||
@@ -511,8 +511,8 @@ async function testParseVersionFile() {
|
||||
const gleam = '0.23.0'
|
||||
const rebar3 = '3.16.0'
|
||||
const toolVersions = `# a comment
|
||||
erlang ${erlang}# comment, no space
|
||||
elixir ${elixir} # comment, with space
|
||||
erlang ref:v${erlang}# comment, no space, and ref:v
|
||||
elixir ref:${elixir} # comment, with space and ref:
|
||||
not-gleam 0.23 # not picked up
|
||||
gleam ${gleam}
|
||||
rebar ${rebar3}`
|
||||
|
||||
Reference in New Issue
Block a user