mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-20 11:07:50 +08:00
feat: handle polaris files on non docker env
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user