add build info to version flag

This commit is contained in:
wh1te909 2022-06-16 22:25:22 -07:00
parent 891b7febcf
commit 42be72f0b4

View File

@ -22,6 +22,7 @@ import (
"os"
"path/filepath"
"runtime"
goDebug "runtime/debug"
"strings"
"time"
@ -138,10 +139,13 @@ func GenerateAgentID() string {
func ShowVersionInfo(ver string) {
fmt.Println("Tactical RMM Agent:", ver)
fmt.Println("Arch:", runtime.GOARCH)
fmt.Println("Go version:", runtime.Version())
if runtime.GOOS == "windows" {
fmt.Println("Program Directory:", filepath.Join(os.Getenv("ProgramFiles"), progFilesName))
}
bi, ok := goDebug.ReadBuildInfo()
if ok {
fmt.Println(bi.String())
}
}
// TotalRAM returns total RAM in GB