10000 Fix tc.find() calls to use the proper name on self-hosted · ruby/setup-ruby@d03a71d · GitHub
[go: up one dir, main page]

Skip to content

Commit d03a71d

Browse files
committed
Fix tc.find() calls to use the proper name on self-hosted
1 parent ddde393 commit d03a71d

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

common.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,18 @@ function getDefaultToolCachePath() {
264264
}
265265
}
266266

267-
export function getToolCacheRubyPrefix(platform, engine, version) {
268-
const toolCache = getToolCachePath()
269-
const name = {
267+
export function engineToToolCacheName(engine) {
268+
return {
270269
ruby: 'Ruby',
271270
jruby: 'JRuby',
272271
truffleruby: 'TruffleRuby',
273272
"truffleruby+graalvm": 'TruffleRubyGraalVM'
274273
}[engine]
275-
return path.join(toolCache, name, version, os.arch())
274+
}
275+
276+
export function getToolCacheRubyPrefix(platform, engine, version) {
277+
const toolCache = getToolCachePath()
278+
return path.join(toolCache, engineToToolCacheName(engine), version, os.arch())
276279
}
277280

278281
export function toolCacheCompleteFile(toolCacheRubyPrefix) {

dist/index.js

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function getAvailableVersions(platform, engine) {
2020
export async function install(platform, engine, version) {
2121
let rubyPrefix, inToolCache
2222
if (common.shouldUseToolCache(engine, version)) {
23-
inToolCache = tc.find('Ruby', version)
23+
inToolCache = tc.find(common.engineToToolCacheName(engine), version)
2424
if (inToolCache) {
2525
rubyPrefix = inToolCache
2626
} else {

windows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function install(platform, engine, version) {
4949

5050
let rubyPrefix, inToolCache
5151
if (common.shouldUseToolCache(engine, version)) {
52-
inToolCache = tc.find('Ruby', version)
52+
inToolCache = tc.find(common.engineToToolCacheName(engine), version)
5353
if (inToolCache) {
5454
rubyPrefix = inToolCache
5555
} else {

0 commit comments

Comments
 (0)
0