From 970f6659fb622e63aa858d967a7104496db0a692 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Fri, 28 Feb 2020 21:36:00 -0600 Subject: [PATCH] Simplify 'tar' in ruby_builder.js - downloadAndExtract --- dist/index.js | 8 ++------ ruby-builder.js | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5b31635..9422460 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3424,12 +3424,8 @@ async function downloadAndExtract(platform, ruby) { console.log(url) const downloadPath = await tc.downloadTool(url) - 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) - } + const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar' + await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ]) return path.join(rubiesDir, ruby) } diff --git a/ruby-builder.js b/ruby-builder.js index 264b31e..0388710 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -36,12 +36,8 @@ async function downloadAndExtract(platform, ruby) { console.log(url) const downloadPath = await tc.downloadTool(url) - 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) - } + const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar' + await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ]) return path.join(rubiesDir, ruby) }