Skip to content

Commit

Permalink
deal with multiple versions in .tool-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jtannas authored and eregon committed Mar 5, 2025
1 parent 04c2e2b commit 277ba2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function parseRubyEngineAndVersion(rubyVersion) {
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
const rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s/.test(e))[0]
rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1]
rubyVersion = rubyLine.split(/\s/)[1]
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
} else if (rubyVersion === 'mise.toml') { // Read from mise.toml
const toolVersions = fs.readFileSync('mise.toml', 'utf8').trim()
Expand Down

0 comments on commit 277ba2a

Please sign in to comment.