-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·65 lines (51 loc) · 2.05 KB
/
setup
File metadata and controls
executable file
·65 lines (51 loc) · 2.05 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
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
# Fetch Forge — first-time setup for fresh clones.
# Usage: ./setup
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
DIM='\033[2m'
RESET='\033[0m'
ok() { echo -e " ${GREEN}✓${RESET} $1"; }
fail() { echo -e " ${RED}✗${RESET} $1"; exit 1; }
info() { echo -e " ${DIM}$1${RESET}"; }
ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT"
echo "Fetch Forge setup"
echo
# ── Prerequisites ────────────────────────────────────────────────────
echo "Checking prerequisites..."
command -v git >/dev/null || fail "git not found"
command -v node >/dev/null || fail "node not found"
ok "git, node"
# ── Submodules ───────────────────────────────────────────────────────
echo
echo "Initialising submodules..."
git submodule update --init --recursive
ok "submodules"
# ── npm dependencies for JS platforms ───────────────────────────────
echo
echo "Installing npm dependencies..."
for dir in \
react-native/background-fetch \
cordova/background-fetch \
capacitor/background-fetch
do
if [[ -d "$ROOT/$dir" && -f "$ROOT/$dir/package.json" ]]; then
echo -e " ${DIM}$dir${RESET}"
(cd "$ROOT/$dir" && npm install --silent)
fi
done
ok "npm dependencies"
# ── Verify ───────────────────────────────────────────────────────────
echo
echo "Verifying..."
"$ROOT/forge" --help >/dev/null 2>&1 && ok "forge CLI" || fail "forge CLI failed"
echo
echo -e "${GREEN}Setup complete.${RESET}"
echo
info "Quick start:"
info " ./forge status # show versions"
info " ./forge build ios # build XCFramework"
info " ./forge build android # build Android AAR"
info " ./forge link-ios all # link local XCFramework for testing"