Skip to content

Commit 01b616c

Browse files
MSP-Gregeregon
authored andcommitted
ruby-builder.js - Win32 - use C:\Windows\system32\tar.exe
1 parent f010ae4 commit 01b616c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

dist/index.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const os = require('os')
22
const path = require('path')
33
const core = require('@actions/core')
4+
const exec = require('@actions/exec')
45
const io = require('@actions/io')
56
const tc = require('@actions/tool-cache')
67
const rubyBuilderVersions = require('./ruby-builder-versions')
@@ -35,7 +36,12 @@ async function downloadAndExtract(platform, ruby) {
3536
console.log(url)
3637

3738
const downloadPath = await tc.downloadTool(url)
38-
await tc.extractTar(downloadPath, rubiesDir)
39+
if (platform.startsWith('windows')) {
40+
let args = [ '-xz', '-C', rubiesDir, '-f', downloadPath ]
41+
await exec.exec('C:\\Windows\\system32\\tar.exe', args)
42+
} else {
43+
await tc.extractTar(downloadPath, rubiesDir)
44+
}
3945

4046
return path.join(rubiesDir, ruby)
4147
}

0 commit comments

Comments
 (0)