Skip to content

Commit

Permalink
fixed path for home dir
Browse files Browse the repository at this point in the history
  • Loading branch information
damoon committed Dec 8, 2021
1 parent c319c02 commit f3b67e2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/d8s/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"net/url"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -44,6 +45,11 @@ var (
)

func main() {
homeDir, err := os.UserHomeDir()
if err != nil {
log.Fatalf("look up user home dir: %v", err)
}

app := &cli.App{
Name: "Wedding client",
Usage: "Make wedding accessible.",
Expand All @@ -56,7 +62,7 @@ func main() {
Name: "kubeconfig",
Usage: "Kubeconfig file to use.",
EnvVars: []string{"WEDDING_KUBECONFIG", "KUBECONFIG"},
Value: "~/.kube/config",
Value: filepath.Join(homeDir, ".kube", "config"),
},
&cli.StringFlag{
Name: "context",
Expand All @@ -79,7 +85,7 @@ func main() {
},
}

err := app.Run(os.Args)
err = app.Run(os.Args)
if err != nil {
log.Println(err)
os.Exit(1)
Expand Down

0 comments on commit f3b67e2

Please sign in to comment.