Skip to content

Commit

Permalink
BuildInfo added to self-compiled compiled binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
rokath committed Mar 21, 2024
1 parent e0f5639 commit 3a4630d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.20
require (
github.com/awesome-gocui/gocui v1.1.0
github.com/fsnotify/fsnotify v1.6.0
github.com/kr/pretty v0.1.0
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
github.com/pkg/errors v0.9.1
github.com/rokath/cobs v0.0.0-20230425030040-4ebbe9b903b9
Expand All @@ -22,6 +23,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.6.0 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
Expand Down
8 changes: 8 additions & 0 deletions internal/args/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (
"fmt"
"io"
"os"
"runtime/debug"
"sync"
"time"

"github.com/kr/pretty"
"github.com/rokath/trice/internal/com"
"github.com/rokath/trice/internal/decoder"
"github.com/rokath/trice/internal/do"
Expand Down Expand Up @@ -43,6 +45,12 @@ func Handler(w io.Writer, fSys *afero.Afero, args []string) error {
Date = fmt.Sprint(err) // just in case, simply show the error
}
}
bi, ok := debug.ReadBuildInfo()
if !ok {
fmt.Println("buildInfo not ok")
} else {
pretty.Println(bi)
}
}

// Verify that a sub-command has been provided: os.Arg[0] is the main command (trice), os.Arg[1] will be the sub-command.
Expand Down

0 comments on commit 3a4630d

Please sign in to comment.