Skip to content

Commit

Permalink
Fix tc.find() calls to use the proper name on self-hosted
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Mar 5, 2023
1 parent ddde393 commit d03a71d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
11 changes: 7 additions & 4 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,18 @@ function getDefaultToolCachePath() {
}
}

export function getToolCacheRubyPrefix(platform, engine, version) {
const toolCache = getToolCachePath()
const name = {
export function engineToToolCacheName(engine) {
return {
ruby: 'Ruby',
jruby: 'JRuby',
truffleruby: 'TruffleRuby',
"truffleruby+graalvm": 'TruffleRubyGraalVM'
}[engine]
return path.join(toolCache, name, version, os.arch())
}

export function getToolCacheRubyPrefix(platform, engine, version) {
const toolCache = getToolCachePath()
return path.join(toolCache, engineToToolCacheName(engine), version, os.arch())
}

export function toolCacheCompleteFile(toolCacheRubyPrefix) {
Expand Down
16 changes: 10 additions & 6 deletions 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 ruby-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function getAvailableVersions(platform, engine) {
export async function install(platform, engine, version) {
let rubyPrefix, inToolCache
if (common.shouldUseToolCache(engine, version)) {
inToolCache = tc.find('Ruby', version)
inToolCache = tc.find(common.engineToToolCacheName(engine), version)
if (inToolCache) {
rubyPrefix = inToolCache
} else {
Expand Down
2 changes: 1 addition & 1 deletion windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function install(platform, engine, version) {

let rubyPrefix, inToolCache
if (common.shouldUseToolCache(engine, version)) {
inToolCache = tc.find('Ruby', version)
inToolCache = tc.find(common.engineToToolCacheName(engine), version)
if (inToolCache) {
rubyPrefix = inToolCache
} else {
Expand Down

0 comments on commit d03a71d

Please sign in to comment.