Some checks reported errors
farmcontrol/farmcontrol-ui/pipeline/head Something is wrong with the build of this commit
- Created electrobun.config.ts to define application settings and build parameters. - Added build-macos.mjs script to handle macOS builds, including architecture targeting. - Introduced finalize-desktop-artifacts.mjs for managing post-build processes and artifact publishing. - Implemented pre-build.mjs for validating required files before the build process. - Added utility scripts for managing release artifacts and syncing views. - Established desktop-specific functionalities in the src/desktop directory, including app update handling and menu management. - Updated .gitignore to include dist directory and test results for cleaner repository management. - Introduced bun.lock for dependency management with Bun.
33 lines
759 B
JavaScript
33 lines
759 B
JavaScript
import { spawnSync } from "node:child_process";
|
|
import { fileURLToPath } from "node:url";
|
|
import path from "node:path";
|
|
|
|
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
const targetArchs = ["arm64", "x64"];
|
|
|
|
function run(command, args, options = {}) {
|
|
const result = spawnSync(command, args, {
|
|
cwd: rootDir,
|
|
stdio: "inherit",
|
|
env: process.env,
|
|
...options,
|
|
});
|
|
|
|
if (result.status !== 0) {
|
|
process.exit(result.status ?? 1);
|
|
}
|
|
}
|
|
|
|
run("bun", ["run", "build"]);
|
|
|
|
for (const targetArch of targetArchs) {
|
|
console.log(`\n=== Building macOS ${targetArch} ===\n`);
|
|
|
|
run("bun", ["electrobun", "build", "--env=stable"], {
|
|
env: {
|
|
...process.env,
|
|
ELECTROBUN_ARCH: targetArch,
|
|
},
|
|
});
|
|
}
|