add KRATOS_HOME environment

pull/2618/head
Mark.li 2 years ago
parent bebea0c103
commit 9fb6b35542
  1. 8
      cmd/kratos/internal/base/path.go

@ -27,7 +27,13 @@ func kratosHome() string {
}
func kratosHomeWithDir(dir string) string {
home := path.Join(kratosHome(), dir)
var home string
kHome := os.Getenv("KRATOS_HOME")
if kHome == "" {
home = path.Join(kratosHome(), dir)
} else {
home = path.Join(kHome, dir)
}
if _, err := os.Stat(home); os.IsNotExist(err) {
if err := os.MkdirAll(home, 0o700); err != nil {
log.Fatal(err)

Loading…
Cancel
Save