mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-21 09:57:35 +08:00
feat: windows app update
This commit is contained in:
21
pkg/utils/dir_lib.go
Normal file
21
pkg/utils/dir_lib.go
Normal file
@@ -0,0 +1,21 @@
|
||||
//go:build lib
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
|
||||
func GetUserDataDir() string {
|
||||
d, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
d = filepath.Join(d, ".polaris")
|
||||
if _, err := os.Stat(d); os.IsNotExist(err) {
|
||||
os.MkdirAll(d, os.ModePerm)
|
||||
}
|
||||
return d
|
||||
}
|
||||
Reference in New Issue
Block a user