2022-07-09 15:44:53 +00:00
|
|
|
# https://taskfile.dev
|
|
|
|
|
|
|
|
version: '3'
|
|
|
|
|
|
|
|
vars:
|
2022-12-13 01:01:44 +00:00
|
|
|
PREFIX: '{{default "/usr/local" .PREFIX}}'
|
2022-07-09 15:44:53 +00:00
|
|
|
bindir__: '{{.PREFIX}}/bin'
|
|
|
|
BINDIR: '{{default .bindir__ .BINDIR}}'
|
|
|
|
libdir__: '{{.PREFIX}}/share/hilbish'
|
|
|
|
LIBDIR: '{{default .libdir__ .LIBDIR}}'
|
2022-12-20 03:19:48 +00:00
|
|
|
goflags__: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}}"'
|
|
|
|
GOFLAGS: '{{default .goflags__ .GOFLAGS}}'
|
2024-07-21 15:37:08 +00:00
|
|
|
lua__: 'lua'
|
|
|
|
LUA: '{{default .lua__ .LUA}}'
|
2022-07-09 15:44:53 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
default:
|
2023-11-12 00:39:31 +00:00
|
|
|
cmds:
|
|
|
|
- go build {{.GOFLAGS}}
|
|
|
|
vars:
|
|
|
|
GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'
|
|
|
|
|
|
|
|
default-nocgo:
|
2022-07-09 15:44:53 +00:00
|
|
|
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-13 01:01:44 +00:00
|
|
|
GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -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
|
|
|
|
2024-07-21 15:37:08 +00:00
|
|
|
midnight:
|
|
|
|
cmds:
|
|
|
|
- go build -tags midnight,{{.LUA}} {{.GOFLAGS}}
|
|
|
|
vars:
|
2024-12-22 05:08:56 +00:00
|
|
|
GOFLAGS: '-ldflags "-X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'
|
2024-07-21 15:37:08 +00:00
|
|
|
|
2022-07-09 15:44:53 +00:00
|
|
|
build:
|
2023-11-12 00:39:31 +00:00
|
|
|
cmds:
|
|
|
|
- go build {{.GOFLAGS}}
|
|
|
|
|
|
|
|
build-nocgo:
|
2022-07-09 15:44:53 +00:00
|
|
|
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}}"
|
2023-02-19 00:02:52 +00:00
|
|
|
- grep -v 'hilbish' /etc/shells > /tmp/shells.hilbish_uninstall && mv /tmp/shells.hilbish_uninstall /etc/shells
|