summaryrefslogtreecommitdiff
path: root/all.go
blob: fbdafc72ed9aeba3279b78c02119d979a2385cca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main

import (
	"fmt"
)

// rethink this. do not run on non-master git branches
func doAll() {
	if argv.All {
		if forge.IsGoWork() {
			var warning []string
			warning = append(warning, "go-mod-clean --recursive may not work unless you are in ~/go/src")
			warning = append(warning, "you can continue anyway, but it hasn't been tested as much.")
			simpleStdin(true, warning)
		}
		var warning []string
		warning = append(warning, "go-mod-clean will recreate go.mod and go.sum")
		warning = append(warning, "because you have selected --recursive")
		warning = append(warning, "this will redo _every_ repo. This is probably fine.")
		warning = append(warning, fmt.Sprintf("You have %d total repositories in %s", forge.Repos.Len(), forge.GetGoSrc()))
		warning = append(warning, "")
		warning = append(warning, "However, this will also, at times, do:")
		warning = append(warning, "")
		warning = append(warning, "rm -rf ~/go/pkg/")
		warning = append(warning, "rm -rf ~/.config/go-build/")
		warning = append(warning, "")
		warning = append(warning, "Which is also probably fine, but will clear all your build cache and go mod cache")
		warning = append(warning, "")
		simpleStdin(false, warning)
		// purgeGoCaches()
	}
}