-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathelectron-prepare.sh
More file actions
executable file
·29 lines (23 loc) · 991 Bytes
/
Copy pathelectron-prepare.sh
File metadata and controls
executable file
·29 lines (23 loc) · 991 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
#!/bin/bash
# Shared preparation steps for all Electron build/pack scripts.
# Builds Next.js (with API route backup), compiles TypeScript, and builds all MCP sub-packages.
set -e
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
# Backup API routes and icon that are incompatible with static export
mv "$REPO_ROOT/src/app/api" "$REPO_ROOT/src/app/_api_backup"
mv "$REPO_ROOT/src/app/icon.tsx" "$REPO_ROOT/src/app/_icon_backup.tsx" 2>/dev/null || true
cleanup() {
mv "$REPO_ROOT/src/app/_api_backup" "$REPO_ROOT/src/app/api" 2>/dev/null || true
mv "$REPO_ROOT/src/app/_icon_backup.tsx" "$REPO_ROOT/src/app/icon.tsx" 2>/dev/null || true
}
trap cleanup EXIT
# Build Next.js static export
ELECTRON_BUILD=1 npx next build
# Compile Electron TypeScript
tsc -p electron/tsconfig.json
# Build all MCP sub-packages
for pkg in mcp-orchestrator mcp-telegram mcp-kanban mcp-vault mcp-socialdata mcp-x mcp-world; do
pushd "$pkg" > /dev/null
npm install && npm run build
popd > /dev/null
done