-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.ts
More file actions
33 lines (27 loc) · 1012 Bytes
/
dev.ts
File metadata and controls
33 lines (27 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env -S deno run -A --watch=static/,routes/
import { Builder } from "fresh/dev"
const builder = new Builder()
if (Deno.args.includes("build")) {
console.log("📦 Copying library files for build...")
try {
// Create new library structure
await Deno.mkdir("static/libraries", { recursive: true })
await Deno.mkdir("static/libraries/boxicons", { recursive: true })
// Copy Boxicons SVG files
const bxSourceDir = "node_modules/.deno/boxicons@2.1.4/node_modules/boxicons/svg"
const bxCommand = new Deno.Command("cp", {
args: ["-ar", bxSourceDir, "static/libraries/boxicons/"],
})
const bxResult = await bxCommand.output()
if (!bxResult.success) {
throw new Error("Failed to copy Boxicons files")
}
console.log("✅ Boxicons files copied successfully")
} catch (error) {
console.error("❌ Failed to copy library files:", error)
Deno.exit(1)
}
await builder.build()
} else {
await builder.listen(() => import("./main.ts"))
}