ruby-builder.js - Win32 - use C:\Windows\system32\tar.exe

This commit is contained in:
MSP-Greg
2020-02-28 17:59:58 +01:00
committed by Benoit Daloze
parent f010ae485f
commit 01b616c294
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -1,6 +1,7 @@
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')
const rubyBuilderVersions = require('./ruby-builder-versions')
@@ -35,7 +36,12 @@ async function downloadAndExtract(platform, ruby) {
console.log(url)
const downloadPath = await tc.downloadTool(url)
await tc.extractTar(downloadPath, rubiesDir)
if (platform.startsWith('windows')) {
let args = [ '-xz', '-C', rubiesDir, '-f', downloadPath ]
await exec.exec('C:\\Windows\\system32\\tar.exe', args)
} else {
await tc.extractTar(downloadPath, rubiesDir)
}
return path.join(rubiesDir, ruby)
}