diff options
| -rw-r--r-- | Makefile | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -5,6 +5,8 @@ SKILLS_DIR := $(HOME)/.claude/skills RULES_DIR := $(HOME)/.claude/rules HOOKS_DIR := $(HOME)/.claude/hooks CLAUDE_DIR := $(HOME)/.claude +LOCAL_BIN := $(HOME)/.local/bin +AI_LAUNCHER := $(CURDIR)/claude-templates/bin/ai SKILLS := $(patsubst %/SKILL.md,%,$(wildcard */SKILL.md)) RULES := $(wildcard claude-rules/*.md) HOOKS := $(wildcard hooks/*.sh hooks/*.py) @@ -206,6 +208,25 @@ install: ## Symlink skills and rules into ~/.claude/ fi \ fi @echo "" + @echo "ai launcher:" + @mkdir -p "$(LOCAL_BIN)" + @chmod +x "$(AI_LAUNCHER)" + @if [ -L "$(LOCAL_BIN)/ai" ]; then \ + target=$$(readlink "$(LOCAL_BIN)/ai"); \ + if [ "$$target" = "$(AI_LAUNCHER)" ]; then \ + echo " skip ai (already linked)"; \ + else \ + rm "$(LOCAL_BIN)/ai"; \ + ln -s "$(AI_LAUNCHER)" "$(LOCAL_BIN)/ai"; \ + echo " relink ai → $(AI_LAUNCHER) (was: $$target)"; \ + fi \ + elif [ -e "$(LOCAL_BIN)/ai" ]; then \ + echo " WARN ai exists and is not a symlink — skipping"; \ + else \ + ln -s "$(AI_LAUNCHER)" "$(LOCAL_BIN)/ai"; \ + echo " link ai → $(LOCAL_BIN)/ai"; \ + fi + @echo "" @echo "done" uninstall: ## Remove global symlinks from ~/.claude/ @@ -247,6 +268,14 @@ uninstall: ## Remove global symlinks from ~/.claude/ echo " skip commands (not a symlink)"; \ fi @echo "" + @echo "ai launcher:" + @if [ -L "$(LOCAL_BIN)/ai" ]; then \ + rm "$(LOCAL_BIN)/ai"; \ + echo " rm ai"; \ + else \ + echo " skip ai (not a symlink)"; \ + fi + @echo "" @echo "done" list: ## Show global install status |
