diff options
| author | Josh Bleecher Snyder <[email protected]> | 2017-05-23 07:45:43 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <[email protected]> | 2017-05-23 08:03:54 -0700 |
| commit | e3c14b831e61871a0abd67aec472e555e26077aa (patch) | |
| tree | 8fc8cce6e72ff132b4a3136e9b87e617a5dfaa29 /cmd/install/install.go | |
| parent | de4cdce2792936278aa04742a63a6760ba67d230 (diff) | |
check whether rc file exists during installation
Diffstat (limited to 'cmd/install/install.go')
| -rw-r--r-- | cmd/install/install.go | 6 |
1 files changed, 5 insertions, 1 deletions
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 } |
