From 8c68cff7624dd797533122509a7d86ed316090c5 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 13 Dec 2024 16:16:18 -0600 Subject: don't work on non-master branches --- exit.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 exit.go (limited to 'exit.go') diff --git a/exit.go b/exit.go new file mode 100644 index 0000000..4664fda --- /dev/null +++ b/exit.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + + "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" +) + +func okExit(check *gitpb.Repo, msg string) { + log.Info("exit() go-mod-clean on", check.GetGoPath(), "ok") + log.DaemonMode(true) + log.Info(msg) + os.Exit(0) +} + +func badExit(check *gitpb.Repo, err error) { + log.DaemonMode(true) + log.Info("go-mod-clean failed: ", err, forge.GetGoSrc()) + if check != nil { + eraseGoMod(check) + } + os.Exit(-1) +} -- cgit v1.2.3