farmcontrol-ui/scripts/generate-app-icons.mjs
Tom Butcher cfd0849cba Add app icon generation script and update related processes
- Introduced a new script `generate-app-icons.mjs` to automate the generation of application and installer icons.
- Updated error messages in the Windows MSI build script and the finalize artifacts script to reference the new icon generation command.
- Refactored the pre-build process to call the new icon generation script, ensuring required icons are created before building.
2026-08-04 01:11:18 +01:00

28 lines
636 B
JavaScript

import path from 'node:path'
import { spawnSync } from 'node:child_process'
import { fileURLToPath } from 'node:url'
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
const steps = [
[
path.join(rootDir, 'scripts/prepare-app-icons.mjs'),
'assets/logos/farmcontrolicon.png'
],
[path.join(rootDir, 'scripts/prepare-installer-icons.mjs')]
]
for (const args of steps) {
const result = spawnSync('bun', args, {
cwd: rootDir,
stdio: 'inherit',
env: process.env
})
if (result.status !== 0) {
process.exit(result.status ?? 1)
}
}
console.log('generate-app-icons: done')