mirror of
https://github.com/github/codeql-action.git
synced 2026-11-08 14:09:51 +00:00
Extract zstd bundles using the tar path found by getTarVersion
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
10
lib/entry-points.js
generated
10
lib/entry-points.js
generated
@@ -183682,13 +183682,13 @@ async function getTarVersion() {
|
||||
if (!match2?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match2[1] };
|
||||
return { type: "gnu", version: match2[1], path: tar };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match2 = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match2?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match2[1] };
|
||||
return { type: "bsd", version: match2[1], path: tar };
|
||||
} else {
|
||||
throw new Error("Unknown tar version");
|
||||
}
|
||||
@@ -183755,10 +183755,10 @@ async function extractTarZst(tar, dest, tarVersion, logger2) {
|
||||
args.push("--overwrite");
|
||||
}
|
||||
args.push("-f", tar instanceof stream.Readable ? "-" : tar, "-C", dest);
|
||||
process.stdout.write(`[command]tar ${args.join(" ")}
|
||||
process.stdout.write(`[command]${tarVersion.path} ${args.join(" ")}
|
||||
`);
|
||||
await new Promise((resolve15, reject) => {
|
||||
const tarProcess = (0, import_child_process.spawn)("tar", args, { stdio: "pipe" });
|
||||
const tarProcess = (0, import_child_process.spawn)(tarVersion.path, args, { stdio: "pipe" });
|
||||
let stdout = "";
|
||||
tarProcess.stdout?.on("data", (data) => {
|
||||
stdout += data.toString();
|
||||
@@ -183785,7 +183785,7 @@ async function extractTarZst(tar, dest, tarVersion, logger2) {
|
||||
if (code !== 0) {
|
||||
reject(
|
||||
new CommandInvocationError(
|
||||
"tar",
|
||||
tarVersion.path,
|
||||
args,
|
||||
code ?? void 0,
|
||||
stdout,
|
||||
|
||||
Reference in New Issue
Block a user