From 92713ef0049a31ea3b3b4927a8a4cc3369e83b58 Mon Sep 17 00:00:00 2001 From: Wil Moore III Date: Sat, 21 Jun 2014 22:05:28 -0600 Subject: [PATCH] expand leading `~` in `GH_CONFIG` path to `$HOME` --- github/configs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/github/configs.go b/github/configs.go index f19a912..5b5f771 100644 --- a/github/configs.go +++ b/github/configs.go @@ -10,6 +10,7 @@ import ( "os" "path/filepath" "strconv" + "strings" ) var ( @@ -145,6 +146,8 @@ func loadFromFile(filename string, v interface{}) error { func configsFile() string { configsFile := os.Getenv("GH_CONFIG") + configsFile = strings.Replace(configsFile, "~", os.Getenv("HOME"), 1) + if configsFile == "" { configsFile = defaultConfigsFile }