forked from 777genius/claude-code-source-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
58 lines (50 loc) · 1.53 KB
/
build.sh
File metadata and controls
58 lines (50 loc) · 1.53 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────
# build.sh — Minimal build / check script for the leaked source
# ─────────────────────────────────────────────────────────────
# Usage:
# ./scripts/build.sh # install + typecheck + lint
# ./scripts/build.sh install # install deps only
# ./scripts/build.sh check # typecheck + lint only
# ─────────────────────────────────────────────────────────────
set -euo pipefail
STEP="${1:-all}"
install_deps() {
echo "── Installing dependencies ──"
if command -v bun &>/dev/null; then
bun install
elif command -v npm &>/dev/null; then
npm install
else
echo "Error: neither bun nor npm found on PATH" >&2
exit 1
fi
}
typecheck() {
echo "── Running TypeScript type-check ──"
npx tsc --noEmit
}
lint() {
echo "── Running Biome lint ──"
npx @biomejs/biome check src/
}
case "$STEP" in
install)
install_deps
;;
check)
typecheck
lint
;;
all)
install_deps
typecheck
lint
;;
*)
echo "Unknown step: $STEP"
echo "Usage: $0 [install|check|all]"
exit 1
;;
esac
echo "── Done ──"