From b8742a8bd51907d245d3c977f80b362f14a15bc7 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 21 Jan 2020 14:59:52 -0500 Subject: [PATCH] Use tool-cache to extract the tar file --- index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 7154ed6..7a9f64b 100644 --- a/index.js +++ b/index.js @@ -17,18 +17,13 @@ async function run() { core.setFailed('environment variable RUNNER_TEMP is undefined'); return; } - const dest = path.join(tmp_dir, 'msys'); - - await io.mkdirP(dest); const distrib = await tc.downloadTool('http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz'); - await exec.exec(`tar`, [ - '-x', '-J', '--force-local', - // For some reason, GNU Tar on Windows expects paths to be slash-separated - '-C', dest.replace(/\\/g, '/'), - '-f', distrib - ]); + const dest = path.join(tmp_dir, 'msys'); + await io.mkdirP(dest); + + await tc.extractTar(distrib, dest); let cmd = path.join(dest, 'msys2do.cmd'); fs.writeFileSync(cmd, [