mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-27 20:36:29 -04:00
Properly set config file path on Windows
This commit is contained in:
@@ -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 = "/"
|
||||
|
||||
@@ -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 = "\\"
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user