Ship as tm with install to GOPATH/bin and sandbox env overrides.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Skruecken
2026-10-19 13:55:54 +02:00
co-authored by Cursor
parent 2dcab9e4d8
commit f3a592f3ea
8 changed files with 110 additions and 19 deletions
+24 -2
View File
@@ -1,10 +1,16 @@
BINARY := task-master
BINARY := tm
CMD := ./cmd/task-master
VERSION_PKG := task/internal/version
GIT_HASH := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
LDFLAGS := -X $(VERSION_PKG).BuildVersion=$(GIT_HASH)
.PHONY: build run version demo
# Default: Go workspace bin (e.g. ~/go/bin). Override with: make install PREFIX=...
GOPATH ?= $(shell go env GOPATH)
PREFIX ?= $(GOPATH)
INSTALL_BIN := $(PREFIX)/bin
DEV_HOME := $(CURDIR)/.dev-home
.PHONY: build run run-dev install uninstall test version demo
build:
go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) $(CMD)
@@ -12,6 +18,22 @@ build:
run: build
./bin/$(BINARY)
# Sandbox: isolated config/data under ./.dev-home (does not touch ~/.config)
run-dev: build
TASK_MASTER_HOME=$(DEV_HOME) ./bin/$(BINARY)
install: build
install -d $(INSTALL_BIN)
install -m 755 bin/$(BINARY) $(INSTALL_BIN)/$(BINARY)
@echo "installed $(INSTALL_BIN)/$(BINARY)"
uninstall:
rm -f $(INSTALL_BIN)/$(BINARY)
@echo "removed $(INSTALL_BIN)/$(BINARY)"
test:
go test ./...
version: build
./bin/$(BINARY) version