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