-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
45 lines (38 loc) · 1.16 KB
/
install.sh
File metadata and controls
45 lines (38 loc) · 1.16 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
#!/bin/bash
# Clawkeeper installer — curl -fsSL https://clawkeeper.dev/install.sh | bash
set -euo pipefail
REPO="https://clawkeeper.dev/clawkeeper.sh"
DEST="$HOME/.local/bin/clawkeeper.sh"
# --- Download ---
echo ""
echo " Installing Clawkeeper..."
echo ""
mkdir -p "$(dirname "$DEST")"
curl -fsSL "$REPO" -o "$DEST"
chmod +x "$DEST"
echo " ✓ Downloaded to $DEST"
echo " ℹ gum (styled terminal UI) will be auto-installed on first run"
# --- Add to PATH for this session ---
case ":$PATH:" in
*":$HOME/.local/bin:"*) ;;
*) export PATH="$HOME/.local/bin:$PATH" ;;
esac
# --- Persist PATH in shell profiles ---
path_line='export PATH="$HOME/.local/bin:$PATH"'
path_added=false
for rc in "$HOME/.zshrc" "$HOME/.bashrc"; do
if [ -f "$rc" ] && ! grep -qF '.local/bin' "$rc" 2>/dev/null; then
printf '\n# Added by Clawkeeper\n%s\n' "$path_line" >> "$rc"
path_added=true
fi
done
if [ "$path_added" = true ]; then
echo " ✓ Added to PATH (restart your shell or run: source ~/.zshrc)"
else
echo " ✓ PATH already configured"
fi
# --- Launch interactive menu ---
echo ""
echo " Launching Clawkeeper..."
echo ""
exec "$DEST" </dev/tty