rm more code

This commit is contained in:
Jeff Carr 2024-11-13 17:03:03 -06:00
parent fb3464abd0
commit 250a96c49f
3 changed files with 14 additions and 36 deletions

View File

@ -2,7 +2,7 @@ VERSION = $(shell git describe --tags)
all: all:
@echo run this from the autotypist dir: @echo run this from the autotypist dir:
@echo " GUIREASON=blah guireleaser" @echo " GUIRELEASE_REASON=notsure guireleaser"
@echo then: @echo then:
@echo " make prepare-release" @echo " make prepare-release"
@echo then: @echo then:
@ -51,6 +51,9 @@ install:
GO111MODULE=off go install -v -x -ldflags " \ GO111MODULE=off go install -v -x -ldflags " \
-X main.VERSION=${VERSION}" -X main.VERSION=${VERSION}"
test: build
GUIRELEASE_REASON=minor ./guireleaser
check-git-clean: check-git-clean:
@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1) @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)

18
main.go
View File

@ -60,14 +60,16 @@ func main() {
os.Exit(0) os.Exit(0)
} }
// sanity check of things that might be around that mess /*
// up things later // sanity check of things that might be around that mess
// check to make sure we have a go.sum here // up things later
gosum := filepath.Join(homeDir, "go/src/go.wit.com/apps/guireleaser/go.sum") // check to make sure we have a go.sum here
if !shell.Exists(gosum) { gosum := filepath.Join(homeDir, "go/src/go.wit.com/apps/guireleaser/go.sum")
log.Info("go.sum must exist here") if !shell.Exists(gosum) {
os.Exit(0) log.Info("go.sum must exist here")
} os.Exit(0)
}
*/
log.Info("Creating the Release Window") log.Info("Creating the Release Window")

View File

@ -169,35 +169,8 @@ func createReleaseBox(box *gui.Node) {
group = me.release.box.NewGroup("experimental and potentially dangerous stuff") group = me.release.box.NewGroup("experimental and potentially dangerous stuff")
grid = group.NewGrid("buildOptions", 0, 0) grid = group.NewGrid("buildOptions", 0, 0)
grid.NewButton("rm -f go.mod go.sum", func() {
me.Disable()
for _, repo := range me.repos.View.AllRepos() {
if whitelist(repo.GoPath()) {
continue
}
if repo.Status.ReadOnly() {
continue
}
repo.Status.Run([]string{"rm", "-f", "go.mod", "go.sum"})
}
me.Enable()
})
grid.NewButton("git reset --hard", func() {
me.Disable()
for _, repo := range me.repos.View.AllRepos() {
if whitelist(repo.GoPath()) {
log.Warn("skipping whitelist", repo.Name())
continue
}
log.Warn("running git reset --hard", repo.Name())
repo.Status.Run([]string{"git", "reset", "--hard"})
}
me.Enable()
})
grid.NewButton("git ls-files |grep go.mod", func() { grid.NewButton("git ls-files |grep go.mod", func() {
// var all []string
for _, repo := range me.repos.View.AllRepos() { for _, repo := range me.repos.View.AllRepos() {
log.Info("repo:", repo.Name()) log.Info("repo:", repo.Name())
if repo.Status.ReadOnly() { if repo.Status.ReadOnly() {