diff options
| author | Jeff Carr <[email protected]> | 2024-02-06 04:02:46 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-06 04:02:46 -0600 |
| commit | 678d6357b1db76aa416048ff3695c5909fd0fd6f (patch) | |
| tree | 43395494619e631b82182102924fb0c3161f52f7 /unix.go | |
| parent | 309cf80e163eac8ea72303d6566a562f9a0347a3 (diff) | |
generate go.work file for pkgsite
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
| -rw-r--r-- | unix.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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) |
