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:
Damir Vandic
2023-08-15 15:05:23 +02:00
committed by GitHub
parent afb8586fc4
commit f35f714d23
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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)
}