Keep manifests at the ZIP root with native tar

This commit is contained in:
SethBurkart123 committed 2026-11-03 17:30:06 +11:00
1 parent 9fd51512e3
commit a5dfb38791
1 file changed
+11 -2
+11 -2
View File
@@ -2,7 +2,14 @@
* Package Chrome/Firefox build folders into Windows-friendly zip files.
*/
import { execFileSync } from "node:child_process";
import { appendFileSync, existsSync, mkdirSync, readFileSync, unlinkSync } from "node:fs";
import {
appendFileSync,
existsSync,
mkdirSync,
readdirSync,
readFileSync,
unlinkSync,
} from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -19,7 +26,9 @@ function zipDirectory(sourceRel, outRel) {
if (existsSync(outZip)) unlinkSync(outZip);
if (process.platform === "win32") {
execFileSync("tar", ["-a", "-cf", outZip, "-C", sourceDir, "."], { stdio: "inherit" });
execFileSync("tar", ["-a", "-cf", outZip, "-C", sourceDir, "--", ...readdirSync(sourceDir)], {
stdio: "inherit",
});
} else {
execFileSync("zip", ["-r", "-q", outZip, "."], { cwd: sourceDir, stdio: "inherit" });
}