Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
- 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.
36 lines
900 B
JavaScript
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);
|