Cleanup PATH for JRuby on Windows

* That way we remove the default Ruby in PATH which was confusing.
This commit is contained in:
Benoit Daloze
2020-02-08 22:14:50 +01:00
parent f422c055c3
commit 30011b6444
4 changed files with 31 additions and 18 deletions
+7 -3
View File
@@ -16,9 +16,13 @@ export function getAvailableVersions(platform, engine) {
export async function install(platform, ruby) {
const rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(path.join(rubyPrefix, 'bin'))
if (ruby.startsWith('rubinius')) {
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
if (platform === 'windows-latest') {
require('./windows').setupPath(undefined, rubyPrefix)
} else {
core.addPath(path.join(rubyPrefix, 'bin'))
if (ruby.startsWith('rubinius')) {
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
}
}
return rubyPrefix