diff --git a/config/config.go b/config/config.go index 750b356a..0fa2984d 100644 --- a/config/config.go +++ b/config/config.go @@ -59,7 +59,19 @@ func GetBinFolderPath() string { return binFolderPath } -func GetDBFolderPath() string { +func GetDBPath() string { + return fmt.Sprintf("%s/%s.db", getDBFolderPath(), GetName()) +} + +func GetLogFolder() string { + logFolderPath := os.Getenv("XUI_LOG_FOLDER") + if logFolderPath == "" { + logFolderPath = "/var/log" + } + return logFolderPath +} + +func getDBFolderPath() string { dbFolderPath := os.Getenv("XUI_DB_FOLDER") if dbFolderPath != "" { return dbFolderPath @@ -87,18 +99,6 @@ func GetDBFolderPath() string { } } -func GetDBPath() string { - return fmt.Sprintf("%s/%s.db", GetDBFolderPath(), GetName()) -} - -func GetLogFolder() string { - logFolderPath := os.Getenv("XUI_LOG_FOLDER") - if logFolderPath == "" { - logFolderPath = "/var/log" - } - return logFolderPath -} - func moveExistingDb(from string, to string) error { if _, err := os.Stat(to); os.IsNotExist(err) { if _, err := os.Stat(from); !os.IsNotExist(err) {