add a stat(file) shortcut

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-30 16:48:57 -06:00
parent 78049e664d
commit 1fda646fef
1 changed files with 9 additions and 0 deletions

View File

@ -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()