-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-skills.sh
More file actions
executable file
·41 lines (35 loc) · 1.13 KB
/
Copy pathinstall-skills.sh
File metadata and controls
executable file
·41 lines (35 loc) · 1.13 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
#!/usr/bin/env bash
# Symlink the paper-review Claude Code skills into ~/.claude/skills/.
# The repo's skills/ directory is the source of truth — edits there are live.
#
# Usage:
# bash install-skills.sh # symlink (default)
# bash install-skills.sh --copy # copy instead of symlink
#
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SRC_DIR="$REPO_DIR/skills"
DEST_DIR="$HOME/.claude/skills"
MODE="symlink"
[[ "${1:-}" == "--copy" ]] && MODE="copy"
mkdir -p "$DEST_DIR"
for skill_path in "$SRC_DIR"/*/; do
name="$(basename "$skill_path")"
target="$DEST_DIR/$name"
# Remove any existing install (dir or symlink)
if [[ -e "$target" || -L "$target" ]]; then
rm -rf "$target"
fi
if [[ "$MODE" == "symlink" ]]; then
ln -s "$skill_path%/" "$target"
# ln above keeps trailing slash on some shells; normalize:
rm -f "$target"
ln -s "${skill_path%/}" "$target"
echo "✓ linked $name -> ${skill_path%/}"
else
cp -R "${skill_path%/}" "$target"
echo "✓ copied $name"
fi
done
echo ""
echo "Done. Restart your Claude Code session for the skills to be picked up."