Install Bundler if needed on Windows

This commit is contained in:
Benoit Daloze
2020-01-05 23:21:44 +01:00
parent 5adac4fda6
commit f06c4d9ab7
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -1,6 +1,7 @@
// Most of this logic is from
// https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js
const fs = require('fs')
const core = require('@actions/core')
const exec = require('@actions/exec')
const tc = require('@actions/tool-cache')
@@ -26,6 +27,10 @@ export async function downloadExtractAndSetPATH(ruby) {
const newPath = setupPath(msys2, rubyPrefix)
core.exportVariable('PATH', newPath)
if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) {
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler --no-document`)
}
return rubyPrefix
}