mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
(goctl): Use .goctl as home if not exists (#4260)
This commit is contained in:
parent
4a14164be1
commit
cf5b080fbe
@ -98,11 +98,12 @@ func GetGoctlHome() (home string, err error) {
|
||||
|
||||
// GetDefaultGoctlHome returns the path value of the goctl home where Join $HOME with .goctl.
|
||||
func GetDefaultGoctlHome() (string, error) {
|
||||
var goctlHomeDir = goctlDir
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
if err == nil {
|
||||
goctlHomeDir = filepath.Join(home, goctlDir)
|
||||
}
|
||||
goctlHomeDir := filepath.Join(home, goctlDir)
|
||||
|
||||
_ = MkdirIfNotExist(goctlHomeDir)
|
||||
return goctlHomeDir, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user