Properly set config file path on Windows

This commit is contained in:
2024-03-07 12:34:50 -05:00
parent d6443c1966
commit b1f3a9eeec
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@ package offline
// EntryRoot path to libmutton entry directory
var EntryRoot = home + "/.local/share/libmutton"
var ConfigPath = home + "/.config/libmutton/libmutton.ini"
// PathSeparator defines the character used to separate directories in a path (platform-specific)
const PathSeparator = "/"
+1
View File
@@ -4,6 +4,7 @@ package offline
// EntryRoot path to libmutton entry directory
var EntryRoot = home + "\\AppData\\Local\\libmutton\\entries"
var ConfigPath = home + "\\AppData\\Local\\libmutton\\libmutton.ini"
// PathSeparator defines the character used to separate directories in a path (platform-specific)
const PathSeparator = "\\"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
// requires readMap: a map of section names to key names (indicates requested values)
// returns configMap: a map of key names to values (sections are irrelevant)
func ReadConfig(readKeys []string) []string {
cfg, err := ini.Load(home + "/.config/libmutton/libmutton.ini")
cfg, err := ini.Load(ConfigPath)
if err != nil {
fmt.Println(AnsiError + "Failed to load libmutton.ini" + AnsiReset)
os.Exit(1)