mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 00:27:15 -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
|
// EntryRoot path to libmutton entry directory
|
||||||
var EntryRoot = home + "/.local/share/libmutton"
|
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)
|
// PathSeparator defines the character used to separate directories in a path (platform-specific)
|
||||||
const PathSeparator = "/"
|
const PathSeparator = "/"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package offline
|
|||||||
|
|
||||||
// EntryRoot path to libmutton entry directory
|
// EntryRoot path to libmutton entry directory
|
||||||
var EntryRoot = home + "\\AppData\\Local\\libmutton\\entries"
|
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)
|
// PathSeparator defines the character used to separate directories in a path (platform-specific)
|
||||||
const PathSeparator = "\\"
|
const PathSeparator = "\\"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
// requires readMap: a map of section names to key names (indicates requested values)
|
// 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)
|
// returns configMap: a map of key names to values (sections are irrelevant)
|
||||||
func ReadConfig(readKeys []string) []string {
|
func ReadConfig(readKeys []string) []string {
|
||||||
cfg, err := ini.Load(home + "/.config/libmutton/libmutton.ini")
|
cfg, err := ini.Load(ConfigPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(AnsiError + "Failed to load libmutton.ini" + AnsiReset)
|
fmt.Println(AnsiError + "Failed to load libmutton.ini" + AnsiReset)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user