diff --git a/vendor/github.com/mitchellh/go-homedir/homedir.go b/vendor/github.com/mitchellh/go-homedir/homedir.go index 6944957d57..47e1f9ef8e 100644 --- a/vendor/github.com/mitchellh/go-homedir/homedir.go +++ b/vendor/github.com/mitchellh/go-homedir/homedir.go @@ -87,7 +87,7 @@ func dirUnix() (string, error) { cmd := exec.Command("getent", "passwd", strconv.Itoa(os.Getuid())) cmd.Stdout = &stdout if err := cmd.Run(); err != nil { - // If "getent" is missing, ignore it + // If the error is ErrNotFound, we ignore it. Otherwise, return it. if err != exec.ErrNotFound { return "", err } @@ -118,6 +118,11 @@ func dirUnix() (string, error) { } func dirWindows() (string, error) { + // First prefer the HOME environmental variable + if home := os.Getenv("HOME"); home != "" { + return home, nil + } + drive := os.Getenv("HOMEDRIVE") path := os.Getenv("HOMEPATH") home := drive + path diff --git a/vendor/vendor.json b/vendor/vendor.json index 67c805e130..7d22438a13 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -2042,8 +2042,10 @@ "revisionTime": "2016-10-13T19:53:42Z" }, { + "checksumSHA1": "V/quM7+em2ByJbWBLOsEwnY3j/Q=", "path": "github.com/mitchellh/go-homedir", - "revision": "d682a8f0cf139663a984ff12528da460ca963de9" + "revision": "b8bc1bf767474819792c23f32d8286a45736f1c6", + "revisionTime": "2016-12-03T19:45:07Z" }, { "path": "github.com/mitchellh/go-linereader",