rm GoSrc()

This commit is contained in:
Jeff Carr 2025-09-11 22:21:25 -05:00
parent cdca120140
commit bafdfb766d
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import (
)
func okExit(check *gitpb.Repo, msg string) {
log.Info("exit() go-mod-clean on", check.GetGoPath(), "ok")
log.Info("exit() go-mod-clean on", check.Namespace, "ok")
log.DaemonMode(true)
log.Info(msg)
os.Exit(0)
@ -16,7 +16,7 @@ func okExit(check *gitpb.Repo, msg string) {
func badExit(check *gitpb.Repo, err error) {
log.DaemonMode(true)
log.Info("go-mod-clean failed: ", err, forge.GetGoSrc())
log.Info("go-mod-clean failed: ", err, forge.Config.ReposDir)
if check != nil {
if argv.Strict != nil {
// if in strict mode, remove the go.mod and go.sum

View File

@ -84,12 +84,12 @@ func findPwdRepo() *gitpb.Repo {
// attempt to use the working directory
// this is probably what happens most of the time
pwd, _ := os.Getwd()
if strings.HasPrefix(pwd, forge.GetGoSrc()) {
gopath := strings.TrimPrefix(pwd, forge.GetGoSrc())
if strings.HasPrefix(pwd, forge.Config.ReposDir) {
gopath := strings.TrimPrefix(pwd, forge.Config.ReposDir)
gopath = strings.Trim(gopath, "/")
check = forge.FindByGoPath(gopath)
if check != nil {
log.Info(check.GetGoPath(), "was found ok in forge")
log.Info(check.Namespace, "was found ok in forge")
return check
}
}