forked from Pharmacist9527/openclaw-manager
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.sh
More file actions
32 lines (25 loc) · 973 Bytes
/
Copy pathsetup.sh
File metadata and controls
32 lines (25 loc) · 973 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
#!/usr/bin/env bash
set -e
# Source profile to ensure node/npm are in PATH
# Use || true to prevent set -e from exiting on profile errors
[ -f "$HOME/.profile" ] && source "$HOME/.profile" 2>/dev/null || true
[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" 2>/dev/null || true
[ -f "$HOME/.zshrc" ] && source "$HOME/.zshrc" 2>/dev/null || true
# Common npm/node paths (including Homebrew on Apple Silicon)
export PATH="/opt/homebrew/bin:$HOME/.npm-global/bin:$HOME/.local/bin:/usr/local/bin:$PATH"
[ -d "$HOME/AppData/Roaming/npm" ] && export PATH="$HOME/AppData/Roaming/npm:$PATH"
echo ""
echo " OpenClaw Quick Setup"
echo ""
if ! command -v node &>/dev/null; then
echo "ERROR: Node.js is not installed."
echo "Please install Node.js 22+ from https://nodejs.org"
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
if [ ! -d "node_modules" ]; then
echo "Installing dependencies..."
npm install --silent
fi
node bin/setup.js