Add seal-home ZCode plugin packaging
This commit is contained in:
1 parent
0959cef1cc
commit
38610d3573
24 files changed
+31884
-1655
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { mkdirSync } from "node:fs";
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const bun = process.env.BUN_BIN || "bun";
|
||||
const output = resolve(root, "dist/bin/seal-home");
|
||||
|
||||
mkdirSync(dirname(output), { recursive: true });
|
||||
run(bun, ["build", "--compile", "--outfile", output, "src/cli.ts"]);
|
||||
|
||||
// Bun's macOS standalone output can carry a stale code-signature blob on
|
||||
// development machines. Re-signing ad hoc keeps the local binary executable.
|
||||
if (process.platform === "darwin") {
|
||||
run("/usr/bin/codesign", ["--remove-signature", output]);
|
||||
run("/usr/bin/codesign", ["--force", "--sign", "-", output]);
|
||||
}
|
||||
|
||||
function run(command, args) {
|
||||
const result = spawnSync(command, args, {
|
||||
cwd: root,
|
||||
stdio: "inherit"
|
||||
});
|
||||
if (result.error) throw result.error;
|
||||
if (result.status !== 0) {
|
||||
throw new Error(`${command} ${args.join(" ")} failed with status ${result.status}`);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user