build!: set datadir of hilbish and change default prefix to /usr/local (#221)

BREAKING (ish) CHANGE: Hilbish will by default install to `/usr/local`. To revert this, set `PREFIX="/usr/"`
pull/215/merge
sammyette 2022-12-12 21:01:44 -04:00 committed by GitHub
parent 8d40179a73
commit 813354b662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -3,19 +3,19 @@
version: '3' version: '3'
vars: vars:
PREFIX: '{{default "/usr" .PREFIX}}' PREFIX: '{{default "/usr/local" .PREFIX}}'
bindir__: '{{.PREFIX}}/bin' bindir__: '{{.PREFIX}}/bin'
BINDIR: '{{default .bindir__ .BINDIR}}' BINDIR: '{{default .bindir__ .BINDIR}}'
libdir__: '{{.PREFIX}}/share/hilbish' libdir__: '{{.PREFIX}}/share/hilbish'
LIBDIR: '{{default .libdir__ .LIBDIR}}' LIBDIR: '{{default .libdir__ .LIBDIR}}'
GOFLAGS: '-ldflags "-s -w"' GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}}"'
tasks: tasks:
default: default:
cmds: cmds:
- CGO_ENABLED=0 go build {{.GOFLAGS}} - CGO_ENABLED=0 go build {{.GOFLAGS}}
vars: 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: build:
cmds: cmds:

View File

@ -14,7 +14,7 @@ var (
.. hilbish.userDir.config .. '/hilbish/?/init.lua;' .. hilbish.userDir.config .. '/hilbish/?/init.lua;'
.. hilbish.userDir.config .. '/hilbish/?/?.lua;' .. hilbish.userDir.config .. '/hilbish/?/?.lua;'
.. hilbish.userDir.config .. '/hilbish/?.lua'` .. hilbish.userDir.config .. '/hilbish/?.lua'`
dataDir = "/usr/share/hilbish" dataDir = "/usr/local/share/hilbish"
preloadPath = dataDir + "/nature/init.lua" preloadPath = dataDir + "/nature/init.lua"
sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config
defaultConfDir = "" defaultConfDir = ""