summaryrefslogtreecommitdiff
path: root/exit.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-13 16:16:18 -0600
committerJeff Carr <[email protected]>2024-12-13 16:16:18 -0600
commit8c68cff7624dd797533122509a7d86ed316090c5 (patch)
tree5cae23d1f096a619180533c24f19380970cca121 /exit.go
parent02bbd75ce1d80f845673c30a004e35f9ce491ab6 (diff)
don't work on non-master branches
Diffstat (limited to 'exit.go')
-rw-r--r--exit.go24
1 files changed, 24 insertions, 0 deletions
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)
+}