diff --git a/common.js b/common.js index 2a84ae4..dc71bc0 100644 --- a/common.js +++ b/common.js @@ -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) { diff --git a/dist/index.js b/dist/index.js index d5af80d..c2a54b5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -289,6 +289,7 @@ __nccwpck_require__.r(__webpack_exports__); __nccwpck_require__.d(__webpack_exports__, { "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile), "drive": () => (/* binding */ drive), + "engineToToolCacheName": () => (/* binding */ engineToToolCacheName), "floatVersion": () => (/* binding */ floatVersion), "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch), "getRunnerToolCache": () => (/* binding */ getRunnerToolCache), @@ -620,15 +621,18 @@ function getDefaultToolCachePath() { } } -function getToolCacheRubyPrefix(platform, engine, version) { - const toolCache = getToolCachePath() - const name = { +function engineToToolCacheName(engine) { + return { ruby: 'Ruby', jruby: 'JRuby', truffleruby: 'TruffleRuby', "truffleruby+graalvm": 'TruffleRubyGraalVM' }[engine] - return path.join(toolCache, name, version, os.arch()) +} + +function getToolCacheRubyPrefix(platform, engine, version) { + const toolCache = getToolCachePath() + return path.join(toolCache, engineToToolCacheName(engine), version, os.arch()) } function toolCacheCompleteFile(toolCacheRubyPrefix) { @@ -68280,7 +68284,7 @@ function getAvailableVersions(platform, engine) { 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 { @@ -68494,7 +68498,7 @@ 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 { diff --git a/ruby-builder.js b/ruby-builder.js index 3281fe7..8dd71c5 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -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 { diff --git a/windows.js b/windows.js index 13a3826..d827071 100644 --- a/windows.js +++ b/windows.js @@ -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 {