From e3c14b831e61871a0abd67aec472e555e26077aa Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 23 May 2017 07:45:43 -0700 Subject: [PATCH] check whether rc file exists during installation --- cmd/install/install.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/install/install.go b/cmd/install/install.go index 0a93128..f6123d1 100644 --- a/cmd/install/install.go +++ b/cmd/install/install.go @@ -81,5 +81,9 @@ func rcFile(name string) string { if err != nil { return "" } - return filepath.Join(u.HomeDir, name) + path := filepath.Join(u.HomeDir, name) + if _, err := os.Stat(path); err != nil { + return "" + } + return path }