summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unix.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/unix.go b/unix.go
index 2bc03c4..d4498e1 100644
--- a/unix.go
+++ b/unix.go
@@ -212,6 +212,15 @@ func IsDirectory(path string) bool {
return info.IsDir()
}
+// returns true if the file exists
+func Exists(file string) bool {
+ _, err := os.Stat(file)
+ if err != nil {
+ return false
+ }
+ return true
+}
+
func VerifyLocalGoRepo(gorepo string) bool {
// Get current user
usr, err := user.Current()