1
0
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:
zu1k 2020-07-22 06:32:13 +08:00
parent ace8309f64
commit e6268057bb

View File

@ -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 {