generate go.work file for pkgsite
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
309cf80e16
commit
678d6357b1
13
unix.go
13
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)
|
||||
|
|
Loading…
Reference in New Issue