From 18aa4f282b20c4bd489213e4ada2f9e3d5076269 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Sat, 23 May 2026 22:25:03 -0700 Subject: [PATCH] build: add make install target for hooksctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runs `go install ./cmd/hooksctl` so it installs into each developer's GOBIN (or $GOPATH/bin) — portable across developers (no sudo, no hardcoded path, cross-platform) rather than copying to /usr/local/bin. --- CLAUDE.md | 1 + Makefile | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index afc58fd..1801247 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,7 @@ There are two binaries: ```sh make build # builds ./bin/hooks and ./bin/hooksctl +make install # go install ./cmd/hooksctl (into $GOBIN, else $GOPATH/bin) make test # go test ./... make lint # golangci-lint run ./... (config in .golangci.yml) make tidy # go mod tidy diff --git a/Makefile b/Makefile index 6125e44..cafe92b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build test lint run dev tidy sqlc sqlc-diff docker-build docker-run docker-test +.PHONY: build install test lint run dev tidy sqlc sqlc-diff docker-build docker-run docker-test GO ?= go HOOKS_BIN := ./bin/hooks @@ -13,6 +13,11 @@ build: $(GO) build -o $(HOOKS_BIN) ./cmd/hooks $(GO) build -o $(HOOKSCTL_BIN) ./cmd/hooksctl +# Installs hooksctl into $GOBIN if set, else $GOPATH/bin (default ~/go/bin). +# Override the destination with `GOBIN=/some/dir make install`. +install: + $(GO) install ./cmd/hooksctl + test: $(GO) test ./...