mirror of
https://github.com/zu1k/nali.git
synced 2025-01-23 05:39:03 +08:00
specific db homedir
This commit is contained in:
parent
52ce39cfd9
commit
11dd415c35
11
main.go
11
main.go
@ -15,11 +15,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setHomePath() {
|
func setHomePath() {
|
||||||
homeDir, err := os.UserHomeDir()
|
homePath := os.Getenv("NALI_DB_HOME")
|
||||||
if err != nil {
|
if homePath == "" {
|
||||||
panic(err)
|
homeDir, err := os.UserHomeDir()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
homePath = filepath.Join(homeDir, ".nali")
|
||||||
}
|
}
|
||||||
homePath := filepath.Join(homeDir, ".nali")
|
|
||||||
constant.HomePath = homePath
|
constant.HomePath = homePath
|
||||||
if _, err := os.Stat(homePath); os.IsNotExist(err) {
|
if _, err := os.Stat(homePath); os.IsNotExist(err) {
|
||||||
if err := os.MkdirAll(homePath, 0777); err != nil {
|
if err := os.MkdirAll(homePath, 0777); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user