farmcontrol-ui/scripts/run-hutch-electrobun.mjs
Tom Butcher 6690516be3
Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
Update dependencies and enhance build scripts for Electrobun
- Updated `electrobun` dependency to version `1.18.4-beta.19` in `package.json` and `bun.lock`.
- Added `rcedit` and `@tweenjs/tween.js` dependencies to `bun.lock`.
- Modified `Jenkinsfile` to clean up additional staging directories for production builds.
- Refactored `electrobun.config.ts` to dynamically read the `package.json` path.
- Introduced new scripts for managing Hutch installation and execution, improving the build process.
- Enhanced artifact finalization logic to support multiple build environments and streamline platform directory resolution.
2026-08-07 21:35:16 +01:00

36 lines
900 B
JavaScript

import { spawnSync } from "node:child_process";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { resolveHutchCommand } from "./resolve-hutch-command.mjs";
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const [, , subcommand, ...rest] = process.argv;
if (!subcommand) {
console.error("usage: run-hutch-electrobun.mjs <dev|build|run> [...args]");
process.exit(1);
}
const ensureHutch = spawnSync(
"bun",
[path.join(rootDir, "scripts/ensure-hutch.mjs")],
{ cwd: rootDir, stdio: "inherit", env: process.env },
);
if (ensureHutch.status !== 0) {
process.exit(ensureHutch.status ?? 1);
}
const hutchCommand = resolveHutchCommand();
const result = spawnSync(
hutchCommand,
["electrobun", subcommand, ...rest],
{
cwd: rootDir,
stdio: "inherit",
env: process.env,
},
);
process.exit(result.status ?? 1);