rm GoSrc()
This commit is contained in:
parent
cdca120140
commit
bafdfb766d
4
exit.go
4
exit.go
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func okExit(check *gitpb.Repo, msg string) {
|
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.DaemonMode(true)
|
||||||
log.Info(msg)
|
log.Info(msg)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
@ -16,7 +16,7 @@ func okExit(check *gitpb.Repo, msg string) {
|
||||||
|
|
||||||
func badExit(check *gitpb.Repo, err error) {
|
func badExit(check *gitpb.Repo, err error) {
|
||||||
log.DaemonMode(true)
|
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 check != nil {
|
||||||
if argv.Strict != nil {
|
if argv.Strict != nil {
|
||||||
// if in strict mode, remove the go.mod and go.sum
|
// if in strict mode, remove the go.mod and go.sum
|
||||||
|
|
6
main.go
6
main.go
|
@ -84,12 +84,12 @@ func findPwdRepo() *gitpb.Repo {
|
||||||
// attempt to use the working directory
|
// attempt to use the working directory
|
||||||
// this is probably what happens most of the time
|
// this is probably what happens most of the time
|
||||||
pwd, _ := os.Getwd()
|
pwd, _ := os.Getwd()
|
||||||
if strings.HasPrefix(pwd, forge.GetGoSrc()) {
|
if strings.HasPrefix(pwd, forge.Config.ReposDir) {
|
||||||
gopath := strings.TrimPrefix(pwd, forge.GetGoSrc())
|
gopath := strings.TrimPrefix(pwd, forge.Config.ReposDir)
|
||||||
gopath = strings.Trim(gopath, "/")
|
gopath = strings.Trim(gopath, "/")
|
||||||
check = forge.FindByGoPath(gopath)
|
check = forge.FindByGoPath(gopath)
|
||||||
if check != nil {
|
if check != nil {
|
||||||
log.Info(check.GetGoPath(), "was found ok in forge")
|
log.Info(check.Namespace, "was found ok in forge")
|
||||||
return check
|
return check
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue