-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
87 lines (76 loc) · 2.22 KB
/
install.sh
File metadata and controls
87 lines (76 loc) · 2.22 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
# XRPL Dev Skill Installer for Claude Code
# Usage: ./install.sh [--project | --path <path>]
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILL_NAME="xrpl-dev"
SOURCE_DIR="$SCRIPT_DIR/skill"
# Default to personal installation
INSTALL_PATH="$HOME/.claude/skills/$SKILL_NAME"
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
--project)
INSTALL_PATH=".claude/skills/$SKILL_NAME"
shift
;;
--path)
INSTALL_PATH="$2"
shift 2
;;
-h|--help)
echo "XRPL Dev Skill Installer"
echo ""
echo "Usage: ./install.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --project Install to current project (.claude/skills/$SKILL_NAME)"
echo " --path PATH Install to custom path"
echo " -h, --help Show this help message"
echo ""
echo "Default: Install to ~/.claude/skills/$SKILL_NAME"
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done
# Check if source directory exists
if [ ! -d "$SOURCE_DIR" ]; then
echo "Error: Source directory '$SOURCE_DIR' not found"
exit 1
fi
# Check if SKILL.md exists
if [ ! -f "$SOURCE_DIR/SKILL.md" ]; then
echo "Error: SKILL.md not found in '$SOURCE_DIR'"
exit 1
fi
# Create parent directory if needed
mkdir -p "$(dirname "$INSTALL_PATH")"
# Check if destination already exists
if [ -d "$INSTALL_PATH" ]; then
echo "Warning: '$INSTALL_PATH' already exists"
read -p "Overwrite? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Installation cancelled"
exit 0
fi
rm -rf "$INSTALL_PATH"
fi
# Copy skill files
echo "Installing XRPL Dev Skill..."
cp -r "$SOURCE_DIR" "$INSTALL_PATH"
echo ""
echo "Successfully installed to: $INSTALL_PATH"
echo ""
echo "Installed files:"
find "$INSTALL_PATH" -type f -name "*.md" | while read -r file; do
echo " - $(basename "$file")"
done
echo ""
echo "The skill is now available in Claude Code."
echo "Try asking about XRPL development to activate it!"