mirror of https://github.com/Hilbis/Hilbish
fix: make macOS config path match Linux (#143)
Also moves some variables around in vars_*.go to accommodate the fix.pull/145/head
parent
0ae31123b9
commit
e34ab5314a
4
main.go
4
main.go
|
@ -44,7 +44,7 @@ func main() {
|
|||
|
||||
// i honestly dont know what directories to use for this
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
case "linux", "darwin":
|
||||
userDataDir = getenv("XDG_DATA_HOME", curuser.HomeDir + "/.local/share")
|
||||
default:
|
||||
// this is fine on windows, dont know about others
|
||||
|
@ -56,7 +56,7 @@ func main() {
|
|||
defaultConfDir = filepath.Join(confDir, "hilbish")
|
||||
} else {
|
||||
// else do ~ substitution
|
||||
defaultConfDir = expandHome(defaultConfDir)
|
||||
defaultConfDir = filepath.Join(expandHome(defaultConfDir), "hilbish")
|
||||
}
|
||||
defaultConfPath = filepath.Join(defaultConfDir, "init.lua")
|
||||
if defaultHistDir == "" {
|
||||
|
|
1
vars.go
1
vars.go
|
@ -3,7 +3,6 @@ package main
|
|||
// String vars that are free to be changed at compile time
|
||||
var (
|
||||
version = "v2.0.0"
|
||||
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
||||
defaultHistDir = ""
|
||||
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"
|
||||
|
||||
|
|
|
@ -17,4 +17,5 @@ var (
|
|||
dataDir = "/usr/local/share/hilbish"
|
||||
preloadPath = dataDir + "/prelude/init.lua"
|
||||
sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config
|
||||
defaultConfDir = getenv("XDG_CONFIG_HOME", "~/.config")
|
||||
)
|
||||
|
|
|
@ -17,4 +17,5 @@ var (
|
|||
dataDir = "/usr/share/hilbish"
|
||||
preloadPath = dataDir + "/prelude/init.lua"
|
||||
sampleConfPath = dataDir + "/.hilbishrc.lua" // Path to default/sample config
|
||||
defaultConfDir = ""
|
||||
)
|
||||
|
|
|
@ -11,4 +11,5 @@ var (
|
|||
dataDir = "~\\Appdata\\Roaming\\Hilbish" // ~ and \ gonna cry?
|
||||
preloadPath = dataDir + "\\prelude\\init.lua"
|
||||
sampleConfPath = dataDir + "\\hilbishrc.lua" // Path to default/sample config
|
||||
defaultConfDir = ""
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue