Skip to content

Commit

Permalink
bugfix: Fix bug that version cannot be parsed in .tool-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Karibash authored and eregon committed Mar 11, 2025
1 parent 277ba2a commit 28233a0
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.split(/\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 28233a0

Please # to comment.