mirror of https://github.com/docker/cli.git
config: keep configDir empty when homedir errors
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
0397c2ca01
commit
47f059db7a
|
@ -28,12 +28,11 @@ var (
|
||||||
func init() {
|
func init() {
|
||||||
if configDir == "" {
|
if configDir == "" {
|
||||||
homedir, err := os.UserHomeDir()
|
homedir, err := os.UserHomeDir()
|
||||||
if err != nil {
|
if err == nil {
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
configDir = filepath.Join(homedir, configFileDir)
|
configDir = filepath.Join(homedir, configFileDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Dir returns the directory the configuration file is stored in
|
// Dir returns the directory the configuration file is stored in
|
||||||
func Dir() string {
|
func Dir() string {
|
||||||
|
|
Loading…
Reference in New Issue