-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·60 lines (51 loc) · 1.45 KB
/
install.sh
File metadata and controls
executable file
·60 lines (51 loc) · 1.45 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
#!/bin/bash
# tikket-statusline installer
set -e
HOOK_DIR="$HOME/.claude/hooks"
SETTINGS="$HOME/.claude/settings.json"
SCRIPT_URL="https://raw.githubusercontent.com/tikket1/tikket-statusline/main/statusline.js"
DEST="$HOOK_DIR/statusline.js"
echo "⚡ Installing tikket-statusline..."
# Create hooks dir
mkdir -p "$HOOK_DIR"
# Download the script
if command -v curl &>/dev/null; then
curl -fsSL "$SCRIPT_URL" -o "$DEST"
elif command -v wget &>/dev/null; then
wget -qO "$DEST" "$SCRIPT_URL"
else
echo "Error: curl or wget required"
exit 1
fi
chmod +x "$DEST"
# Configure Claude Code settings
if [ ! -f "$SETTINGS" ]; then
echo '{}' > "$SETTINGS"
fi
# Check if statusLine is already configured
if grep -q '"statusLine"' "$SETTINGS" 2>/dev/null; then
echo ""
echo "⚠ statusLine already configured in $SETTINGS"
echo " Replace it manually with:"
echo ""
echo ' "statusLine": {'
echo ' "type": "command",'
echo " \"command\": \"node \\\"$DEST\\\"\""
echo ' }'
echo ""
else
# Use node to safely merge into settings JSON
node -e "
const fs = require('fs');
const settings = JSON.parse(fs.readFileSync('$SETTINGS', 'utf8'));
settings.statusLine = {
type: 'command',
command: 'node \"$DEST\"'
};
fs.writeFileSync('$SETTINGS', JSON.stringify(settings, null, 2) + '\n');
"
echo "✓ Added statusLine to $SETTINGS"
fi
echo "✓ Installed to $DEST"
echo ""
echo "Restart Claude Code to see your new statusline!"