-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.64 KB
/
Makefile
File metadata and controls
62 lines (49 loc) · 1.64 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
BINARY := claude-gatekeeper
INSTALL_DIR := $(HOME)/.claude/hooks
CONFIG_SRC := gatekeeper.toml
CONFIG_DST := $(HOME)/.claude/gatekeeper.toml
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -s -w -X main.version=$(VERSION)
.PHONY: build test lint fmt vet check install uninstall clean plugin-test init-config download
build:
go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/claude-gatekeeper
test:
go test -race -count=1 ./...
lint:
golangci-lint run ./...
fmt:
@test -z "$$(gofmt -l .)" || (gofmt -l . && echo "Run 'gofmt -w .' to fix" && exit 1)
vet:
go vet ./...
check: fmt vet lint test
init-config:
@mkdir -p $(HOME)/.claude
@if [ ! -f $(CONFIG_DST) ]; then \
cp $(CONFIG_SRC) $(CONFIG_DST); \
echo "Installed default config: $(CONFIG_DST)"; \
else \
echo "Config already exists: $(CONFIG_DST) (skipped)"; \
fi
install: build init-config
mkdir -p $(INSTALL_DIR)
cp bin/$(BINARY) $(INSTALL_DIR)/$(BINARY)
$(INSTALL_DIR)/$(BINARY) setup --binary $(INSTALL_DIR)/$(BINARY)
@echo ""
@echo "To migrate existing permissions:"
@echo " $(INSTALL_DIR)/$(BINARY) migrate"
@echo ""
@echo "For debug mode, edit ~/.claude/settings.json and append --debug to the command."
uninstall:
$(INSTALL_DIR)/$(BINARY) uninstall || true
rm -f $(INSTALL_DIR)/$(BINARY)
@echo "Uninstall complete."
plugin-test: build
@echo "Run Claude Code with this plugin:"
@echo " claude --plugin-dir $(CURDIR)"
@echo ""
@echo "First install the default config (if not already present):"
@echo " make init-config"
download:
./bin/install.sh
clean:
rm -f bin/claude-gatekeeper bin/claude-gatekeeper.exe