2022-07-09 15:44:53 +00:00
|
|
|
# https://taskfile.dev
|
|
|
|
|
|
|
|
version: '3'
|
|
|
|
|
|
|
|
vars:
|
|
|
|
PREFIX: '{{default "/usr" .PREFIX}}'
|
|
|
|
bindir__: '{{.PREFIX}}/bin'
|
|
|
|
BINDIR: '{{default .bindir__ .BINDIR}}'
|
|
|
|
libdir__: '{{.PREFIX}}/share/hilbish'
|
|
|
|
LIBDIR: '{{default .libdir__ .LIBDIR}}'
|
2022-12-06 14:29:47 +00:00
|
|
|
GOFLAGS: '-ldflags "-s -w"'
|
2022-07-09 15:44:53 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
default:
|
|
|
|
cmds:
|
2022-10-10 22:55:03 +00:00
|
|
|
- CGO_ENABLED=0 go build {{.GOFLAGS}}
|
2022-07-09 15:44:53 +00:00
|
|
|
vars:
|
2022-12-06 14:29:47 +00:00
|
|
|
GOFLAGS: '-ldflags "-s -w -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'
|
2022-07-09 15:44:53 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
cmds:
|
2022-10-10 22:55:03 +00:00
|
|
|
- CGO_ENABLED=0 go build {{.GOFLAGS}}
|
2022-07-09 15:44:53 +00:00
|
|
|
|
|
|
|
install:
|
|
|
|
cmds:
|
|
|
|
- install -v -d "{{.DESTDIR}}{{.BINDIR}}/" && install -m 0755 -v hilbish "{{.DESTDIR}}{{.BINDIR}}/hilbish"
|
|
|
|
- mkdir -p "{{.DESTDIR}}{{.LIBDIR}}"
|
|
|
|
- cp -r libs docs emmyLuaDocs nature .hilbishrc.lua {{.DESTDIR}}{{.LIBDIR}}
|
|
|
|
- grep -qxF "{{.DESTDIR}}{{.BINDIR}}/hilbish" /etc/shells || echo "{{.DESTDIR}}{{.BINDIR}}/hilbish" >> /etc/shells
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
cmds:
|
|
|
|
- rm -vrf
|
|
|
|
"{{.DESTDIR}}{{.BINDIR}}/hilbish"
|
|
|
|
"{{.DESTDIR}}{{.LIBDIR}}"
|
|
|
|
- sed -i '/hilbish/d' /etc/shells
|