-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-directions.sh
More file actions
executable file
·71 lines (61 loc) · 1.98 KB
/
Copy pathinstall-directions.sh
File metadata and controls
executable file
·71 lines (61 loc) · 1.98 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
66
67
68
69
70
71
#!/bin/bash
#
# Directions Plugin Installer
# Installs Directions as a Claude Code plugin with hooks and commands
#
set -e
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check for Python 3 (required for hooks)
if ! command -v python3 &> /dev/null; then
echo "⚠️ Warning: Python 3 not found."
echo " Some hooks (session-start, doc-suggester) require Python 3."
echo " Install with: brew install python3"
echo ""
read -p "Continue anyway? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
PLUGIN_DIR="$HOME/.claude/plugins/local/directions"
COMMANDS_DIR="$HOME/.claude/commands"
CLAUDE_MD="$HOME/.claude/CLAUDE.md"
echo "Installing Directions plugin..."
echo ""
# Create directories
mkdir -p "$(dirname "$PLUGIN_DIR")"
mkdir -p "$COMMANDS_DIR"
# Symlink plugin
if [ -L "$PLUGIN_DIR" ]; then
echo "Updating existing plugin symlink..."
rm "$PLUGIN_DIR"
elif [ -d "$PLUGIN_DIR" ]; then
echo "Warning: $PLUGIN_DIR exists as a directory. Backing up..."
mv "$PLUGIN_DIR" "$PLUGIN_DIR.backup.$(date +%Y%m%d)"
fi
ln -sf "$SCRIPT_DIR" "$PLUGIN_DIR"
echo "✓ Plugin symlinked to $PLUGIN_DIR"
# Copy commands
cp "$SCRIPT_DIR/commands/"*.md "$COMMANDS_DIR/"
echo "✓ Commands copied to $COMMANDS_DIR"
# Handle CLAUDE.md
if [ -f "$CLAUDE_MD" ]; then
echo ""
echo "Found existing ~/.claude/CLAUDE.md"
echo "You may want to manually merge changes from CLAUDE-GLOBAL-TEMPLATE.md"
echo "Template location: $SCRIPT_DIR/CLAUDE-GLOBAL-TEMPLATE.md"
else
cp "$SCRIPT_DIR/CLAUDE-GLOBAL-TEMPLATE.md" "$CLAUDE_MD"
echo "✓ Created $CLAUDE_MD from template"
echo ""
echo "⚠️ Edit ~/.claude/CLAUDE.md to set your local paths:"
echo " - Local master: $SCRIPT_DIR"
fi
echo ""
echo "Installation complete!"
echo ""
echo "Next steps:"
echo "1. Restart Claude Code for hooks to take effect"
echo "2. Run /directions to see all available commands"
echo ""