forked from bots-garden/ori
| ✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme | 1 | // Copies the Material icon SVGs from vscode-material-icons into public/, so |
| 2 | // Vite ships them as static assets. Runs automatically before `dev` and | |
| 3 | // `build` (npm pre-hooks); the copy is skipped when already present. | |
| 4 | import { cpSync, existsSync } from "node:fs"; | |
| 5 | import { fileURLToPath } from "node:url"; | |
| 6 | ||
| 7 | const source = fileURLToPath( | |
| 8 | new URL( | |
| 9 | "../node_modules/vscode-material-icons/generated/icons", | |
| 10 | import.meta.url, | |
| 11 | ), | |
| 12 | ); | |
| 13 | const destination = fileURLToPath( | |
| 14 | new URL("../public/material-icons", import.meta.url), | |
| 15 | ); | |
| 16 | ||
| 17 | if (!existsSync(destination)) { | |
| 18 | cpSync(source, destination, { recursive: true }); | |
| 19 | console.log("material icons copied to public/material-icons"); | |
| 20 | } |