Repository navigation
Expand file tree
/
Copy pathsetup
More file actions
42 lines (35 loc) · 1.42 KB
/
Copy pathsetup
File metadata and controls
42 lines (35 loc) · 1.42 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
#!/usr/bin/env bash
# hornflow setup — make `hornflow` available on PATH and register the /hornflow skill.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
c_grn() { printf '\033[32m%s\033[0m\n' "$*"; }
c_yel() { printf '\033[33m%s\033[0m\n' "$*"; }
chmod +x "$ROOT/bin/hornflow" 2>/dev/null || true
# 1) Put hornflow on PATH via a shim in ~/.local/bin (created if missing).
BIN_DIR="$HOME/.local/bin"
mkdir -p "$BIN_DIR"
cat >"$BIN_DIR/hornflow" <<EOF
#!/usr/bin/env bash
exec "$ROOT/bin/hornflow" "\$@"
EOF
chmod +x "$BIN_DIR/hornflow"
c_grn "✓ installed shim: $BIN_DIR/hornflow -> $ROOT/bin/hornflow"
case ":$PATH:" in
*":$BIN_DIR:"*) : ;;
*) c_yel "⚠ $BIN_DIR is not on your PATH. Add it, e.g.:"
echo " echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.bashrc" ;;
esac
# 2) Register the /hornflow skill (copy on Windows so it survives without symlink perms).
SKILL_DST="$HOME/.claude/skills/hornflow"
mkdir -p "$(dirname "$SKILL_DST")"
rm -rf "$SKILL_DST"
case "$(uname -s)" in
MINGW*|MSYS*|CYGWIN*|Windows_NT) cp -R "$ROOT/skill/hornflow" "$SKILL_DST" ;;
*) ln -snf "$ROOT/skill/hornflow" "$SKILL_DST" ;;
esac
c_grn "✓ registered skill: $SKILL_DST (restart Claude Code to load /hornflow)"
# 3) Sanity-check the toolchain.
"$ROOT/bin/hornflow" setup || true
c_grn "✓ hornflow setup complete."
echo " Try: hornflow --help"
echo " Note: on Windows this uses file copies — re-run ./setup after 'git pull'."