-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathstart-dev-server.sh
More file actions
31 lines (28 loc) · 972 Bytes
/
start-dev-server.sh
File metadata and controls
31 lines (28 loc) · 972 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
#!/usr/bin/env bash
set -eu
ROOT="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SERVER_DIR="$ROOT/Overlord-Server"
BUN_BIN="${BUN_BIN:-bun}"
# detect platform
OS="$(uname -s)"
case "$OS" in
Darwin) PLATFORM="mac";;
Linux) PLATFORM="linux";;
*) PLATFORM="unknown";;
esac
echo "[server] platform detected: $OS ($PLATFORM)"
cd "$SERVER_DIR"
if ! command -v "$BUN_BIN" >/dev/null 2>&1; then
echo "[server] bun not found. Set BUN_BIN to your bun binary or install bun for this environment." >&2
exit 1
fi
echo "[server] using bun at: $(command -v $BUN_BIN)"
echo "[server] bun install..."
"$BUN_BIN" install
echo "[server] building vendor assets..."
"$BUN_BIN" run vendor
echo "[server] starting bun dev (foreground)"
# Use exec so the script process is replaced by the bun process. This keeps the
# bun process as a child of the dispatcher so the dispatcher can kill it.
export OVERLORD_AGENT_TOKEN="dev-token-insecure-local-only"
exec "$BUN_BIN" run dev