ShiboSoftwareDev/linux-gameboy-advance

A four-layer Linux handheld game-console carrier PCB built around an F1C100S SoC, USB-C and 2×AA power, LCD/microSD interfaces, flash, audio amplifier/speaker, controls, service headers, and RGB status LED.

Version
1.0.124
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}`)