farmcontrol-ui/scripts/patch-electrobun-src.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

24 lines
934 B
JavaScript

import { cpSync, existsSync, mkdirSync, writeFileSync } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
const electrobunDir = path.join(rootDir, 'node_modules/electrobun')
const rceditSrc = path.join(rootDir, 'node_modules/rcedit')
const rceditDest = path.join(electrobunDir, 'node_modules/rcedit')
if (!existsSync(rceditSrc)) {
console.error(
'patch-electrobun-src: rcedit not found. Install it with `bun add -d rcedit`.'
)
process.exit(1)
}
mkdirSync(path.join(electrobunDir, 'node_modules'), { recursive: true })
cpSync(rceditSrc, rceditDest, { recursive: true, force: true })
const markerPath = path.join(electrobunDir, '.farmcontrol-electrobun-patched')
writeFileSync(markerPath, `patched-at=${new Date().toISOString()}\n`)
console.log('patch-electrobun-src: rcedit ready for electrobun builds')