fix: extract archive on linux
This commit is contained in:
17
dist/index.js
generated
vendored
17
dist/index.js
generated
vendored
@@ -28292,6 +28292,7 @@ const tc = __importStar(__nccwpck_require__(3472));
|
||||
const core = __importStar(__nccwpck_require__(7484));
|
||||
const util = __importStar(__nccwpck_require__(4527));
|
||||
const httpm = __importStar(__nccwpck_require__(4844));
|
||||
const exec = __importStar(__nccwpck_require__(5236));
|
||||
/**
|
||||
* Download a specific version of the Zig.
|
||||
* @param version The version to download
|
||||
@@ -28322,7 +28323,21 @@ async function download(version) {
|
||||
extractedPath = await tc.extractZip(archivePath);
|
||||
}
|
||||
else {
|
||||
extractedPath = await tc.extractTar(archivePath);
|
||||
let exit = await exec.exec('mkdir', ['-p', `/tmp/zig-${version}`]);
|
||||
if (exit !== 0) {
|
||||
throw new Error(`Failed to create directory /tmp/zig-${version}`);
|
||||
}
|
||||
exit = await exec.exec('tar', [
|
||||
'-x',
|
||||
'--strip-components=1',
|
||||
'--warning=no-unknown-keyword',
|
||||
'--overwrite',
|
||||
'-C',
|
||||
`/tmp/zig-${version}`,
|
||||
'-f',
|
||||
archivePath
|
||||
]);
|
||||
extractedPath = `/tmp/zig-${version}`;
|
||||
}
|
||||
const cachedPath = await tc.cacheDir(extractedPath, 'zig', version);
|
||||
return cachedPath;
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user