-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·37 lines (29 loc) · 978 Bytes
/
setup.sh
File metadata and controls
executable file
·37 lines (29 loc) · 978 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
34
35
36
37
#!/bin/bash
set -euo pipefail
echo "Setting up BattleGrid..."
# Rust via rustup
if ! command -v rustup &>/dev/null; then
echo "Installing Rust via rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi
rustup target add wasm32-unknown-unknown 2>/dev/null || true
command -v wasm-pack &>/dev/null || ./scripts/cargo-safe.sh install wasm-pack
# Node.js check
if ! command -v node &>/dev/null; then
echo "ERROR: Install Node.js from https://nodejs.org"
exit 1
fi
if ! command -v pnpm &>/dev/null; then
echo "Installing pnpm..."
npm install -g pnpm
fi
# Install client deps
./scripts/pnpm-safe.sh --prefix client install
./scripts/client-safe.sh playwright install chromium
# Path-delimiter-safe client tool smoke checks
./scripts/client-safe.sh tsc --version >/dev/null
./scripts/client-safe.sh vite --version >/dev/null
# Build WASM
make build-wasm
echo "Done! Run 'make dev' to start."