Skip to content

Use tool-cache to extract the tar file #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down