-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
67 lines (60 loc) · 1.61 KB
/
Taskfile.yaml
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
64
65
66
67
# This is a Taskfile. See https://taskfile.dev
# `brew install go-task` to install task runner or `go install github.com/go-task/task/v3/cmd/task@latest`
# `task --list` to list all tasks
# `task <taskname>` to run a task
version: '3'
tasks:
build:
desc: Build binaries
cmds:
- go build -ldflags="-X github.com/hilli/go-kef-w2/cmd.Version={{.GIT_COMMIT}}" -o bin/kefw2{{exeExt}} cmd/kefw2/kefw2.go
aliases: [b]
sources:
- cmd/kefw2/**/*.go
- kefw2/*.go
generates:
- bin/kefw2
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h
complete:
desc: Generate bash/zsh completion script
aliases: [c]
cmds:
- bin/kefw2 completion bash > {{.SHELL_COMP_PREFIX}}/share/bash-completion/completions/kefw2
- bin/kefw2 completion zsh > {{.SHELL_COMP_PREFIX}}/share/zsh-completions/_kefw2
sources:
- cmd/kefw2/**/*.go
- kefw2/*.go
- Taskfile.yaml
generates:
- "{{.SHELL_COMP_PREFIX}}/share/bash-completion/completions/kefw2"
- "{{.SHELL_COMP_PREFIX}}/share/zsh-completions/_kefw2"
vars:
SHELL_COMP_PREFIX:
sh: |
if [ "$(type brew)" ]; then
brew --prefix
else
mkdir -p share/bash-completion/completions
mkdir -p share/zsh-completions
echo .
fi
all:
desc: Run all tasks
aliases: [a]
silent: true
cmds:
- task build
- task complete
clean:
desc: Clean up
aliases: [x]
silent: true
cmds:
- rm -rf bin
- rm -rf share
includes:
docs:
taskfile: ./docs/Taskfile.yaml
dir: ./docs