From 5441c17c59fc7b43528c720ed782e91395caa762 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Tue, 6 Dec 2022 12:36:56 -0400 Subject: [PATCH] build: set datadir of hilbish properly if PREFIX or LIBDIR changes --- Taskfile.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 54b5ea0..16a2cdd 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -3,19 +3,19 @@ version: '3' vars: - PREFIX: '{{default "/usr" .PREFIX}}' + PREFIX: '{{default (eq .OS "darwin" | ternary "/usr/local" "/usr") .PREFIX}}' bindir__: '{{.PREFIX}}/bin' BINDIR: '{{default .bindir__ .BINDIR}}' libdir__: '{{.PREFIX}}/share/hilbish' LIBDIR: '{{default .libdir__ .LIBDIR}}' - GOFLAGS: '-ldflags "-s -w"' + GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}}"' tasks: default: cmds: - CGO_ENABLED=0 go build {{.GOFLAGS}} vars: - GOFLAGS: '-ldflags "-s -w -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"' + 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)"' build: cmds: