Skip to content

Commit

Permalink
Merge pull request #2106 from tiborvass/config-remove-panic-init
Browse files Browse the repository at this point in the history
config: keep configDir empty when homedir errors
  • Loading branch information
tiborvass authored Sep 25, 2019
2 parents 0397c2c + 47f059d commit 0914f51
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ var (
func init() {
if configDir == "" {
homedir, err := os.UserHomeDir()
if err != nil {
panic(err)
if err == nil {
configDir = filepath.Join(homedir, configFileDir)
}
configDir = filepath.Join(homedir, configFileDir)
}
}

Expand Down

0 comments on commit 0914f51

Please sign in to comment.