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, [