Skip to content

Commit 970f665

Browse files
MSP-Gregeregon
authored andcommitted
Simplify 'tar' in ruby_builder.js - downloadAndExtract
1 parent 01b616c commit 970f665

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

dist/index.js

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@ async function downloadAndExtract(platform, ruby) {
3636
console.log(url)
3737

3838
const downloadPath = await tc.downloadTool(url)
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-
}
39+
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
40+
await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])
4541

4642
return path.join(rubiesDir, ruby)
4743
}

0 commit comments

Comments
 (0)