diff --git a/main.go b/main.go index 760f73c..f712404 100644 --- a/main.go +++ b/main.go @@ -15,11 +15,14 @@ func main() { } func setHomePath() { - homeDir, err := os.UserHomeDir() - if err != nil { - panic(err) + 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 {