summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/unix.go b/unix.go
index d4498e1..ddd9379 100644
--- a/unix.go
+++ b/unix.go
@@ -212,6 +212,19 @@ func IsDirectory(path string) bool {
return info.IsDir()
}
+func (rs *RepoStatus) Exists(filename string) bool {
+ usr, err := user.Current()
+ if err != nil {
+ log.Error(err, "Exists() error: could not determine what your username is")
+ return false
+ }
+ testf := filepath.Join(usr.HomeDir, "go/src/", rs.String(), filename)
+ if Exists(testf) {
+ return true
+ }
+ return false
+}
+
// returns true if the file exists
func Exists(file string) bool {
_, err := os.Stat(file)