ShiboSoftwareDev/linux-gameboy-advance

A multilayer PCB carrier board routing the MCU, USB‑C, battery/AA power selector and TPS63020 regulator, LCD/SD interfaces, UART/I²C/SPI service headers, controls, audio/status LEDs, and backlight with reviewed traces and vias.

Version
1.0.125
License
unset
Stars
0

scripts/render-manual-enclosure.mjs

import { copyFileSync } from "node:fs"
import { spawnSync } from "node:child_process"
import { fileURLToPath } from "node:url"

const projectDirectory = fileURLToPath(new URL("../", import.meta.url))
const generatedPreview = fileURLToPath(new URL("../dist/dist/index/3d.png", import.meta.url))
const sitePreview = fileURLToPath(new URL("../dist/index/3d.png", import.meta.url))

const result = spawnSync(
  "tsci",
  ["build", "dist/index/circuit.json", "--ignore-config", "--3d", "--concurrency", "1"],
  { cwd: projectDirectory, stdio: "inherit" },
)
if (result.error) throw result.error
if (result.status !== 0) {
  throw new Error(`manual enclosure preview failed with exit code ${result.status}`)
}

copyFileSync(generatedPreview, sitePreview)
console.log(`[enclosure] installed native manual printed-part preview at ${sitePreview}`)