farmcontrol-server/scripts/build-linux.mjs
Tom Butcher 8741a2c6fd
Some checks failed
farmcontrol/farmcontrol-server/pipeline/head There was a failure building this commit
Enhance build configuration and scripts
- Updated electrobun.config.ts to include environment-based settings for stability and external dependencies.
- Refactored package.json scripts for improved build processes and streamlined commands.
- Added new build scripts for Linux and renderer, while removing the obsolete build-server script.
- Enhanced pre-build validation to ensure required files are present and added logging for better visibility.
- Updated clean-build script to remove additional artifact directories for thorough cleanup.
2026-08-01 21:13:51 +01:00

36 lines
907 B
JavaScript

import { spawnSync } from "node:child_process";
import path from "node:path";
import { fileURLToPath } from "node:url";
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
function run(scriptRelativePath) {
const scriptPath = path.join(rootDir, scriptRelativePath);
const result = spawnSync("bun", [scriptPath], {
cwd: rootDir,
stdio: "inherit",
env: process.env,
});
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}
function runBash(scriptRelativePath) {
const scriptPath = path.join(rootDir, scriptRelativePath);
const result = spawnSync("bash", [scriptPath], {
cwd: rootDir,
stdio: "inherit",
env: process.env,
});
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}
run("scripts/write-build-info.mjs");
run("scripts/build-linux-binary.mjs");
runBash("scripts/build-linux-packages.sh");