summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/main.go b/main.go
index b5431b6..0f0ee1a 100644
--- a/main.go
+++ b/main.go
@@ -125,10 +125,20 @@ func clone() {
badExit(err)
}
- // update go.sum and go.mod
- // todo: only do this if they don't exist?
- // todo: make these git commit metadata
- pb.RedoGoMod()
+ if err := pb.ValidGoSum(); err != nil {
+ // update go.sum and go.mod
+ if err := pb.RunStrict([]string{"go-mod-clean"}); err != nil {
+ log.Info("")
+ log.Info("Do you have go-mod-clean? Otherwise:")
+ log.Info(" go install go.wit.com/apps/go-mod-clean@latest")
+ log.Info("")
+ badExit(err)
+ }
+ }
+ if err := pb.ValidGoSum(); err != nil {
+ log.Info("could not generate valid go.sum file")
+ badExit(err)
+ }
// double check it actually downloaded
fullgitdir := filepath.Join(forge.GetGoSrc(), argv.Repo, ".git")