-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
35 lines (27 loc) · 1.04 KB
/
Copy pathinstall.sh
File metadata and controls
35 lines (27 loc) · 1.04 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
#!/usr/bin/env bash
# install.sh — sets up cc-statusline for Claude Code
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SETTINGS="$HOME/.claude/settings.json"
echo "Installing cc-statusline from $REPO_DIR..."
# Update settings.json to point to this repo's script
if [ -f "$SETTINGS" ]; then
# Replace the statusLine command in settings.json
if command -v python3 &>/dev/null; then
python3 - <<EOF
import json, sys
with open('$SETTINGS', 'r') as f:
cfg = json.load(f)
cfg.setdefault('statusLine', {})['command'] = 'bash $REPO_DIR/statusline-command.sh'
with open('$SETTINGS', 'w') as f:
json.dump(cfg, f, indent=2)
print('Updated settings.json')
EOF
else
echo "python3 not found — manually set in $SETTINGS:"
echo " \"statusLine\": { \"command\": \"bash $REPO_DIR/statusline-command.sh\" }"
fi
else
echo "settings.json not found at $SETTINGS"
echo "Manually add: \"statusLine\": { \"command\": \"bash $REPO_DIR/statusline-command.sh\" }"
fi
echo "Done! Restart Claude Code to apply changes."