This is an automated email from the ASF dual-hosted git repository.

pdesai pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bf2617  Add fallback method to find wskprops when go-client fails 
(#1015)
7bf2617 is described below

commit 7bf2617461857e77642b3f82e99ffa1d9691d783
Author: Matt Rutkowski <[email protected]>
AuthorDate: Wed Nov 28 13:03:24 2018 -0600

    Add fallback method to find wskprops when go-client fails (#1015)
---
 utils/misc.go | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/utils/misc.go b/utils/misc.go
index 715db30..b32c092 100644
--- a/utils/misc.go
+++ b/utils/misc.go
@@ -60,10 +60,19 @@ type RuleRecord struct {
        Packagename string
 }
 
+func fallbackHome() string {
+       if home := os.Getenv("HOME"); home != "" {
+               return home
+       }
+       // For Windows.
+       return os.Getenv("UserProfile")
+}
+
 func GetHomeDirectory() string {
        usr, err := user.Current()
        if err != nil {
-               return ""
+
+               return fallbackHome()
        }
 
        return usr.HomeDir

Reply via email to