@@ -0,0 +1,53 @@
1+diff --git a/cmd/cluster_kubeconfig.go b/cmd/cluster_kubeconfig.go
2+index 54cc0c9..fab288a 100644
3+--- a/cmd/cluster_kubeconfig.go
4++++ b/cmd/cluster_kubeconfig.go
5+@@ -6,7 +6,7 @@ import (
6+ "io/ioutil"
7+ "log"
8+ "os"
9+- "os/user"
10++ "path/filepath"
11+ "strings"
12+
13+ "github.com/spf13/cobra"
14+@@ -52,9 +52,8 @@ Example 4: hetzner-kube cluster kubeconfig -n my-cluster -p > my-conf.yaml # pri
15+ } else {
16+ fmt.Println("create file")
17+
18+- usr, _ := user.Current()
19+- dir := usr.HomeDir
20+- path := fmt.Sprintf("%s/.kube", dir)
21++ dir, _ := os.UserHomeDir()
22++ path := filepath.Join(dir, ".kube")
23+
24+ if _, err := os.Stat(path); os.IsNotExist(err) {
25+ os.MkdirAll(path, 0755)
26+diff --git a/cmd/config.go b/cmd/config.go
27+index ce0f3e5..a03c4ba 100644
28+--- a/cmd/config.go
29++++ b/cmd/config.go
30+@@ -8,7 +8,6 @@ import (
31+ "io/ioutil"
32+ "log"
33+ "os"
34+- "os/user"
35+ "path/filepath"
36+
37+ "github.com/hetznercloud/hcloud-go/hcloud"
38+@@ -28,13 +27,8 @@ type AppSSHClient struct {
39+ // NewAppConfig creates a new AppConfig struct using the locally saved configuration file. If no local
40+ // configuration file is found a new config will be created.
41+ func NewAppConfig() AppConfig {
42+- usr, err := user.Current()
43+- if err != nil {
44+- return AppConfig{}
45+- }
46+- if usr.HomeDir != "" {
47+- DefaultConfigPath = filepath.Join(usr.HomeDir, ".hetzner-kube")
48+- }
49++ dir, _ := os.UserHomeDir()
50++ DefaultConfigPath = filepath.Join(dir, ".hetzner-kube")
51+
52+ appConf := AppConfig{
53+ Context: context.Background(),