summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-06 04:02:46 -0600
committerJeff Carr <[email protected]>2024-02-06 04:02:46 -0600
commit678d6357b1db76aa416048ff3695c5909fd0fd6f (patch)
tree43395494619e631b82182102924fb0c3161f52f7 /unix.go
parent309cf80e163eac8ea72303d6566a562f9a0347a3 (diff)
generate go.work file for pkgsite
Signed-off-by: Jeff Carr <[email protected]>
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)