-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskills.sh
More file actions
24 lines (20 loc) · 795 Bytes
/
Copy pathskills.sh
File metadata and controls
24 lines (20 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
set -eu
skill_name="ax-grep-cli"
target_root="${CODEX_HOME:-"$HOME/.codex"}/skills"
target_dir="$target_root/$skill_name"
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" 2>/dev/null && pwd)
local_skill="$script_dir/skills/$skill_name/SKILL.md"
remote_skill="${AX_GREP_SKILL_URL:-https://raw.githubusercontent.com/hmmhmmhm/ax-grep/main/skills/ax-grep-cli/SKILL.md}"
mkdir -p "$target_dir"
if [ -f "$local_skill" ]; then
cp "$local_skill" "$target_dir/SKILL.md"
elif command -v curl >/dev/null 2>&1; then
curl -fsSL "$remote_skill" -o "$target_dir/SKILL.md"
elif command -v wget >/dev/null 2>&1; then
wget -qO "$target_dir/SKILL.md" "$remote_skill"
else
echo "Could not find local skill file, curl, or wget." >&2
exit 1
fi
echo "Installed $skill_name skill to $target_dir"