-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
63 lines (50 loc) · 1.92 KB
/
justfile
File metadata and controls
63 lines (50 loc) · 1.92 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
# Binary name and build directory
binary_name := "wt"
build_dir := "bin"
# Show available recipes
default:
@just --list
# Build the binary
build:
mkdir -p {{build_dir}}
go build -o {{build_dir}}/{{binary_name}} .
# Install to /usr/local/bin (requires sudo)
install: build
sudo cp {{build_dir}}/{{binary_name}} /usr/local/bin/
# Install to ~/bin (no sudo required)
install-user: build
mkdir -p ~/bin
cp {{build_dir}}/{{binary_name}} ~/bin/
@echo "Make sure ~/bin is in your PATH"
# Clean build artifacts
clean:
go clean
rm -rf {{build_dir}}
# Run unit tests
test:
go test -v -short ./...
# Print shell integration that runs wt from source (for local development)
dev-shellenv:
test -f {{justfile_directory()}}/go.work || (cd {{justfile_directory()}} && go work init .)
go run . shellenv | sed "s|command wt |env GOWORK={{justfile_directory()}}/go.work go run {{justfile_directory()}} |g"
# Run e2e tests with all available shells
e2e: build
go run e2e/run.go --wt={{build_dir}}/{{binary_name}} --verbose
# Run e2e tests with specific shells (comma-separated)
e2e-shells shells: build
go run e2e/run.go --wt={{build_dir}}/{{binary_name}} --shells={{shells}} --verbose
# Run e2e tests with bash only
e2e-bash: build
go run e2e/run.go --wt={{build_dir}}/{{binary_name}} --shells=bash --verbose
# Run e2e tests with zsh only
e2e-zsh: build
go run e2e/run.go --wt={{build_dir}}/{{binary_name}} --shells=zsh --verbose
# Run all tests (unit + e2e)
test-all: test e2e
# Cross-compile for multiple platforms
build-all:
mkdir -p {{build_dir}}
GOOS=linux GOARCH=amd64 go build -o {{build_dir}}/{{binary_name}}-linux-amd64 .
GOOS=darwin GOARCH=amd64 go build -o {{build_dir}}/{{binary_name}}-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o {{build_dir}}/{{binary_name}}-darwin-arm64 .
GOOS=windows GOARCH=amd64 go build -o {{build_dir}}/{{binary_name}}-windows-amd64.exe .