-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (41 loc) · 1.18 KB
/
Makefile
File metadata and controls
51 lines (41 loc) · 1.18 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
# CWT Makefile
.PHONY: test build clean lint install run help
# Default target
help:
@echo "Available targets:"
@echo " test - Run all tests"
@echo " build - Build the binary"
@echo " clean - Clean build artifacts"
@echo " lint - Run linters (if available)"
@echo " install - Install the binary"
@echo " run - Run with arguments (use ARGS=...)"
@echo " help - Show this help"
# Run tests
test:
go test ./internal/... -v
# Build the binary
build:
go build -o cwt ./cmd/cwt
# Clean build artifacts
clean:
rm -f cwt
# Run linters (requires golangci-lint)
lint:
@if command -v golangci-lint > /dev/null; then \
golangci-lint run; \
else \
echo "golangci-lint not found. Install with: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest"; \
fi
# Install the binary to GOPATH/bin
install:
go install ./cmd/cwt
# Run with arguments (make run ARGS="new test-session")
run: build
./cwt $(ARGS)
# Development: watch for changes and run tests
watch:
@if command -v fswatch > /dev/null; then \
fswatch -o . -e ".*" -i "\\.go$$" | xargs -n1 -I{} make test; \
else \
echo "fswatch not found. Install with: brew install fswatch (macOS)"; \
fi