check whether rc file exists during installation

This commit is contained in:
Josh Bleecher Snyder 2017-05-23 07:45:43 -07:00
parent de4cdce279
commit e3c14b831e
1 changed files with 5 additions and 1 deletions

View File

@ -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
}