Single commit repo (#95)

* supporting repos with one commit
This commit is contained in:
Zachary Rice authored and GitHub committed 2018-09-26 14:28:22 -05:00
1 parent 8eb28cbb4c
commit fad98cbde2
216 files changed
+27523 -3828

No files matched your search

+1
View File
@@ -0,0 +1 @@
module github.com/mitchellh/go-homedir
+6 -4
View File
@@ -141,14 +141,16 @@ func dirWindows() (string, error) {
return home, nil
}
// Prefer standard environment variable USERPROFILE
if home := os.Getenv("USERPROFILE"); home != "" {
return home, nil
}
drive := os.Getenv("HOMEDRIVE")
path := os.Getenv("HOMEPATH")
home := drive + path
if drive == "" || path == "" {
home = os.Getenv("USERPROFILE")
}
if home == "" {
return "", errors.New("HOMEDRIVE, HOMEPATH, and USERPROFILE are blank")
return "", errors.New("HOMEDRIVE, HOMEPATH, or USERPROFILE are blank")
}
return home, nil