Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/gitbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"rss-parser": "^3.13.0"
},
"scripts": {
"generate": "./scripts/generate.sh",
"generate": "bun ./scripts/generate.mjs",
"clean": "rm -rf ./.next && rm -rf ./public/~gitbook/static/icons && rm -rf ./public/~gitbook/static/math",
"dev": "env-cmd --silent -f ../../.env.local next --webpack",
"build": "next build --webpack",
Expand Down
19 changes: 19 additions & 0 deletions packages/gitbook/scripts/generate.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { execSync } from "child_process";
import { cpSync } from "fs";
import { platform } from "os";

const isWindows = platform() === "win32";

function run(cmd) {
return execSync(cmd, { shell: true }).toString();
}

if (isWindows) {
run(`powershell -Command "Copy-Item -Recurse -Force ..\\embed\\standalone\\ .\\public\\~gitbook\\static\\embed"`);
} else {
run("cp -r ../embed/standalone/ ./public/~gitbook/static/embed");
}

run("bunx gitbook-icons ./public/~gitbook/static/icons custom-icons");
run("bunx gitbook-math ./public/~gitbook/static/math");
run("bunx wrangler types");
12 changes: 0 additions & 12 deletions packages/gitbook/scripts/generate.sh

This file was deleted.