aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2d744a1..fdbb70b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ RULES_DIR := $(HOME)/.claude/rules
HOOKS_DIR := $(HOME)/.claude/hooks
CLAUDE_DIR := $(HOME)/.claude
CODEX_DIR := $(HOME)/.codex
+CODEX_HOOKS := $(CURDIR)/.codex/hooks.json
LOCAL_BIN := $(HOME)/.local/bin
AI_LAUNCHER := $(CURDIR)/claude-templates/bin/ai
SKILLS := $(patsubst %/SKILL.md,%,$(wildcard */SKILL.md))
@@ -231,6 +232,19 @@ install: ## Symlink skills, rules, config, hooks, and bin scripts into place
ln -s "$(CURDIR)/claude-templates/AGENTS.md" "$(CODEX_DIR)/AGENTS.md"; \
echo " link AGENTS.md → $(CODEX_DIR)/AGENTS.md"; \
fi
+ @if [ -L "$(CODEX_DIR)/hooks.json" ]; then \
+ target=$$(readlink "$(CODEX_DIR)/hooks.json"); \
+ if [ "$$target" = "$(CODEX_HOOKS)" ]; then \
+ echo " skip hooks.json (already linked)"; \
+ else \
+ echo " WARN hooks.json links elsewhere ($$target) — skipping"; \
+ fi; \
+ elif [ -e "$(CODEX_DIR)/hooks.json" ]; then \
+ echo " WARN hooks.json exists and is not a symlink — skipping"; \
+ else \
+ ln -s "$(CODEX_HOOKS)" "$(CODEX_DIR)/hooks.json"; \
+ echo " link hooks.json → $(CODEX_DIR)/hooks.json"; \
+ fi
@echo ""
@echo "Hooks (default):"
@for hook in $(DEFAULT_HOOKS); do \
@@ -317,6 +331,13 @@ uninstall: ## Remove global symlinks from ~/.claude/
else \
echo " skip commands (not a symlink)"; \
fi
+ @if [ -L "$(CODEX_DIR)/hooks.json" ] \
+ && [ "$$(readlink "$(CODEX_DIR)/hooks.json")" = "$(CODEX_HOOKS)" ]; then \
+ rm "$(CODEX_DIR)/hooks.json"; \
+ echo " rm codex hooks.json"; \
+ else \
+ echo " skip codex hooks.json (not our symlink)"; \
+ fi
@echo ""
@echo "ai launcher:"
@if [ -L "$(LOCAL_BIN)/ai" ]; then \