-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
63 lines (48 loc) · 1.33 KB
/
justfile
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
GIT_DIR := `git rev-parse --show-toplevel`
BIN_NAME := "showdown"
BIN_DIR := "bin"
DIST_DIR := "dist"
# list available recipes
default:
@just --list
# format code
fmt:
go fmt ./...
generate:
go generate ./...
# lint code
lint: generate
golangci-lint run ./...
# vet code
vet: generate
go vet ./...
# build application
build *args="": generate
{{GIT_DIR}}/scripts/build.sh {{args}}
# create binary distribution
dist *args="":
{{GIT_DIR}}/scripts/dist.sh {{args}}
# create a new release
release *args="": clean generate
{{GIT_DIR}}/scripts/release.sh {{args}}
changes from="" to="":
#!/bin/sh
source {{GIT_DIR}}/scripts/functions.sh
get_changes {{from}} {{to}}
clean:
@# generated files
@echo "rm -r pkg/server/assets"
@rm -r pkg/server/assets 2>/dev/null || true
@# build artifacts
@echo "rm {{BIN_DIR}}/{{BIN_NAME}}"
@-[ -f {{BIN_DIR}}/{{BIN_NAME}} ] && rm {{BIN_DIR}}/{{BIN_NAME}}
@-[ -d {{BIN_DIR}} ] && rmdir {{BIN_DIR}}
@# distribution archives
@echo "rm {{DIST_DIR}}/{{BIN_NAME}}_*.tar.gz"
@rm {{DIST_DIR}}/{{BIN_NAME}}_*.tar.gz 2>/dev/null || true
@echo "rm {{DIST_DIR}}/{{BIN_NAME}}_*.zip"
@rm {{DIST_DIR}}/{{BIN_NAME}}_*.zip 2>/dev/null || true
@-[ -d {{DIST_DIR}} ] && rmdir {{DIST_DIR}}
# ---
_system-info:
@echo "{{os()}}_{{arch()}}"