summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-20 09:39:31 -0600
committerJeff Carr <[email protected]>2025-02-20 09:39:31 -0600
commitee4933837656f61b6bd765510864702658abb920 (patch)
tree8be27bd566c3eb5a30d2ca3ce519e618f672a40a /main.go
parente86ac8c7284d7ac3a70e8215608058dc3a8b1b65 (diff)
new autogenpbv0.0.39
Diffstat (limited to 'main.go')
-rw-r--r--main.go35
1 files changed, 32 insertions, 3 deletions
diff --git a/main.go b/main.go
index 018446d..417b227 100644
--- a/main.go
+++ b/main.go
@@ -4,18 +4,18 @@
package main
import (
+ "debug/buildinfo"
"fmt"
"os"
"path/filepath"
"unicode"
"go.wit.com/dev/alexflint/arg"
- "go.wit.com/lib/gui/shell"
- "go.wit.com/log"
-
"go.wit.com/gui"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
+ "go.wit.com/log"
)
// sent via -ldflags
@@ -38,6 +38,7 @@ func main() {
argv.doBashAuto()
os.Exit(0)
}
+ dumpDebug()
failed = make(map[*gitpb.Repo]string)
state = make(map[*gitpb.Repo]string)
@@ -289,3 +290,31 @@ func badExit(err error) {
log.Info("go-clean failed: ", err, me.forge.GetGoSrc())
os.Exit(-1)
}
+
+func dumpDebug() {
+ // Get absolute path of the currently running binary
+ exePath, err := os.Executable()
+ if err != nil {
+ fmt.Println("Error getting executable path:", err)
+ return
+ }
+
+ // Resolve symlinks if necessary
+ exePath, err = filepath.EvalSymlinks(exePath)
+ if err != nil {
+ fmt.Println("Error resolving symlink:", err)
+ return
+ }
+
+ // Read build info
+ bi, err := buildinfo.ReadFile(exePath)
+ if err != nil {
+ fmt.Println("Error reading build info:", err)
+ return
+ }
+
+ fmt.Println("Go Version:", bi.GoVersion)
+ for _, dep := range bi.Deps {
+ fmt.Printf("Dependency: %s %s\n", dep.Path, dep.Version)
+ }
+}