blob: c5760e0d11265705fe3d884831ff3eb3a0576886 (
plain)
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
34
35
36
37
38
|
#!/usr/bin/env bash
# Build the Windows Electron output via electron-builder.
# Produces an unpacked directory at packages/frontend/release/win-unpacked.
#
# Usage:
# bin/build-pkg-windows
#
# Override the API URL the frontend bundle points to:
# VITE_API_URL="http://your-host:18390" bin/build-pkg-windows
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
FRONTEND_DIR="$PROJECT_DIR/packages/frontend"
VITE_API_URL="${VITE_API_URL:-http://localhost:18390}"
cd "$PROJECT_DIR"
# Install deps (electron + electron-builder live as frontend devDependencies)
bun install
# Build the SPA bundle, then package it for Windows (unpacked dir)
cd "$FRONTEND_DIR"
VITE_API_URL="$VITE_API_URL" bun run dist:win
WIN_BUILD="$FRONTEND_DIR/release/win-unpacked"
if [ ! -d "$WIN_BUILD" ]; then
echo "Build failed: no win-unpacked directory found at $WIN_BUILD" >&2
exit 1
fi
echo ""
echo "Windows Electron build ready at:"
echo " $WIN_BUILD"
echo ""
echo "Copy that folder to a Windows machine and run Dispatch.exe."
|