add verbose

This commit is contained in:
Jeff Carr 2025-03-05 05:11:50 -06:00
parent 8d5d7ca85c
commit 236a7cb5e8
1 changed files with 11 additions and 3 deletions

View File

@ -70,9 +70,17 @@ func rillRestore(repo *gitpb.Repo) error {
return nil
}
log.Info("go-mod-clean --smart START", repo.GetGoPath())
_, err := repo.RunQuiet([]string{"go-mod-clean", "--smart"})
log.Info("go-mod-clean --smart END", repo.GetGoPath())
var err error
if argv.Verbose {
log.Info("go-mod-clean --smart START", repo.GetGoPath())
result := repo.RunRealtime([]string{"go-mod-clean", "--smart"})
log.Info("go-mod-clean --smart END", repo.GetGoPath())
if result.Exit != 0 {
err = fmt.Errorf("repo %s failed %d", repo.GetGoPath(), result.Exit)
}
} else {
_, err = repo.RunQuiet([]string{"go-mod-clean", "--smart"})
}
rillcount += 1
if err != nil {
log.Info("go-mod-clean --smart failed", repo.GetGoPath(), err)