Reorganize path manipulation, mswin tools ENV

1. Use only one 'core' call to set PATH
2. Clean PATH
3. Windows mswin - add vcvars*.bat changes to ENV
This commit is contained in:
MSP-Greg
2020-03-07 13:41:58 +01:00
committed by Benoit Daloze
parent c125fbc596
commit 8d89ffaa2b
4 changed files with 886 additions and 1621 deletions
+1 -12
View File
@@ -1,6 +1,5 @@
const os = require('os')
const path = require('path')
const core = require('@actions/core')
const exec = require('@actions/exec')
const io = require('@actions/io')
const tc = require('@actions/tool-cache')
@@ -15,17 +14,7 @@ export function getAvailableVersions(platform, engine) {
export async function install(platform, ruby) {
const rubyPrefix = await downloadAndExtract(platform, ruby)
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
return [rubyPrefix, null]
}
async function downloadAndExtract(platform, ruby) {