aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-15 17:02:34 -0500
committerCraig Jennings <c@cjennings.net>2026-05-15 17:02:34 -0500
commit2d645fcfcebf27e89dd30169e7122ff5bbb49dcc (patch)
treefafe6bd07b286ef1e754517667d954cf8fbd5574 /Makefile
parent3a4af17707c8020becb9e7ee2c47f573c1a45e38 (diff)
downloadrulesets-2d645fcfcebf27e89dd30169e7122ff5bbb49dcc.tar.gz
rulesets-2d645fcfcebf27e89dd30169e7122ff5bbb49dcc.zip
chore(make): fold bin/ai launcher install into rulesets
The ai launcher's install/uninstall logic lived in claude-templates/Makefile when claude-templates was a separate repo. After the fold, that Makefile still works locally but rulesets' make install is the single entry point. Add ai-launcher targets to rulesets/Makefile so `make install` covers it alongside skills, rules, commands, and Claude config. Install detects an existing symlink pointing at a stale source (e.g. ~/projects/claude-templates/bin/ai from before the fold) and relinks to the new canonical path under ~/code/rulesets/claude-templates/bin/ai.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 38d5151..087e734 100644
--- a/Makefile
+++ b/Makefile
@@ -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