build for windows #374
This commit is contained in:
+6
-1
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -51,9 +52,13 @@ func GetDBFolderPath() string {
|
||||
if dbFolderPath == "" {
|
||||
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
if err != nil {
|
||||
// Cross-platform fallback path
|
||||
if runtime.GOOS == "windows" {
|
||||
return "C:\\Program Files\\s-ui\\db"
|
||||
}
|
||||
return "/usr/local/s-ui/db"
|
||||
}
|
||||
dbFolderPath = dir + "/db"
|
||||
dbFolderPath = filepath.Join(dir, "db")
|
||||
}
|
||||
return dbFolderPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user