Skip to content

Commit 277ba2a

Browse files
jtannaseregon
authored andcommitted
deal with multiple versions in .tool-versions
1 parent 04c2e2b commit 277ba2a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function parseRubyEngineAndVersion(rubyVersion) {
130130
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
131131
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
132132
const rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s/.test(e))[0]
133-
rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1]
133+
rubyVersion = rubyLine.split(/\s/)[1]
134134
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
135135
} else if (rubyVersion === 'mise.toml') { // Read from mise.toml
136136
const toolVersions = fs.readFileSync('mise.toml', 'utf8').trim()

0 commit comments

Comments
 (0)