From 678d6357b1db76aa416048ff3695c5909fd0fd6f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 6 Feb 2024 04:02:46 -0600 Subject: generate go.work file for pkgsite Signed-off-by: Jeff Carr --- unix.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'unix.go') 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) -- cgit v1.2.3