kube-forge v2: embede python with ansible (kubespray) and cobra as cli building tool
This commit is contained in:
15
cmd/utils.go
Normal file
15
cmd/utils.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os/user"
|
||||
)
|
||||
|
||||
func GetUserHomeDir() string {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
log.Fatalf("cant get user home directory: %v", err)
|
||||
}
|
||||
homePath := usr.HomeDir
|
||||
return homePath
|
||||
}
|
||||
Reference in New Issue
Block a user