feat: handle polaris files on non docker env

This commit is contained in:
Simon Ding
2025-08-31 23:55:36 +08:00
parent 3967e7b77d
commit d15f04e69c
2 changed files with 21 additions and 3 deletions

View File

@@ -2,6 +2,20 @@
package utils
import (
"os"
"path/filepath"
)
func GetUserDataDir() string {
return "./data"
}
if IsRunningInDocker() {
return "./data"
}
homeDir, _ := os.UserHomeDir()
dir := filepath.Join(homeDir, ".polaris")
if _, err := os.Stat(dir); os.IsNotExist(err) {
os.MkdirAll(dir, 0755)
}
return dir
}