Skip to content
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
20 changes: 19 additions & 1 deletion make.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { execSync } from "child_process";
import { copyFileSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
import { platform } from "os";

//Check if using MacOS
const isMac = process.platform === "darwin";

// Used to have items writable during build on MacOS
import fs from "fs";

const run = (cmd) => execSync(cmd, { stdio: "inherit" });

const binPath = platform() === "win32" ? ".\\build\\float.exe" : "./build/float";
Expand All @@ -22,7 +28,19 @@ copyFileSync(process.execPath, binPath);
writeFileSync("./build/version", JSON.parse(readFileSync("./package.json")).version);

// Create the blob
run("node --experimental-sea-config ./sea-config.json");
if (isMac) {
execSync("node --experimental-sea-config sea-config.json", {
stdio: "inherit",
});
// Set permissions for float which otherwise breaks the build or run
fs.chmodSync("./build/float", 0o755);

console.log("macOS SEA build complete (no postject)");
process.exit(0);
}
else{
run("node --experimental-sea-config ./sea-config.json");
}

// Inject the blob
run(`npx postject ${binPath} NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA`);
Expand Down