made getDBFolderPath func private

This commit is contained in:
fgsfds 2025-08-09 17:37:18 +05:00
parent bb29167ecf
commit 4bc3b27aaa
No known key found for this signature in database
GPG key ID: 264C1B9113012917

View file

@ -59,7 +59,19 @@ func GetBinFolderPath() string {
return binFolderPath 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") dbFolderPath := os.Getenv("XUI_DB_FOLDER")
if dbFolderPath != "" { if dbFolderPath != "" {
return 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 { func moveExistingDb(from string, to string) error {
if _, err := os.Stat(to); os.IsNotExist(err) { if _, err := os.Stat(to); os.IsNotExist(err) {
if _, err := os.Stat(from); !os.IsNotExist(err) { if _, err := os.Stat(from); !os.IsNotExist(err) {