opencode-config/.opencode/draw-image/scripts/sync-lucide.mjs
Sergey 56b67d2d5c
feat(draw-image): SVG template renderer for on-brand covers (#134)
* feat(draw-image): add SVG template render engine

* feat(draw-image): add opencode plugin and tool tests

* test(draw-image): add vitest unit integration e2e suite

* chore(draw-image): wire CI dependabot docs and ADR

* docs(handoff): set PR number

* docs(handoff): fix PR number placeholder in frontmatter

* fix(ci): use tempfile and trailing newline in draw-image tests

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-29 23:42:50 +03:00

23 lines
No EOL
788 B
JavaScript

import { existsSync, mkdirSync, readdirSync, copyFileSync } from "node:fs"
import path from "node:path"
import { fileURLToPath } from "node:url"
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const drawImageDir = path.resolve(__dirname, "..")
const lucideSrc = path.join(drawImageDir, "node_modules", "lucide-static", "icons")
const lucideDst = path.join(drawImageDir, "icons", "lucide")
if (!existsSync(lucideSrc)) {
console.log("lucide-static not installed, skipping icon sync")
process.exit(0)
}
mkdirSync(lucideDst, { recursive: true })
let count = 0
for (const file of readdirSync(lucideSrc)) {
if (file.endsWith(".svg")) {
copyFileSync(path.join(lucideSrc, file), path.join(lucideDst, file))
count++
}
}
console.log(`synced ${count} lucide icons`)