-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (51 loc) · 1.36 KB
/
Makefile
File metadata and controls
63 lines (51 loc) · 1.36 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
63
.PHONY: build run test lint clean dev
# Build the binary
build:
go build -o mctui .
# Run in development mode
run:
go run .
# Run with hot reload (requires air: go install github.com/air-verse/air@latest)
dev:
air
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-cover:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Lint (tries golangci-lint, falls back to go vet)
lint:
@if command -v golangci-lint >/dev/null; then \
golangci-lint run; \
else \
echo "golangci-lint not found, running go vet instead..."; \
go vet ./...; \
fi
# Format code
fmt:
go fmt ./...
@if command -v goimports >/dev/null; then \
goimports -w .; \
fi
# Tidy dependencies
tidy:
go mod tidy
# Clean build artifacts
clean:
rm -f mctui
rm -f coverage.out coverage.html
# Build for all platforms
build-all:
GOOS=darwin GOARCH=amd64 go build -o dist/mctui-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o dist/mctui-darwin-arm64 .
GOOS=linux GOARCH=amd64 go build -o dist/mctui-linux-amd64 .
GOOS=windows GOARCH=amd64 go build -o dist/mctui-windows-amd64.exe .
# Reset authentication (deletes accounts.json)
# Note: config path logic might vary, this assumes default Linux/Mac path
reset-auth:
rm -f ~/.local/share/mctui/accounts.json
# Reset all data (instances, cache, auth)
reset-all:
rm -rf ~/.local/share/mctui