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" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
goDebug "runtime/debug"
"strings" "strings"
"time" "time"
@ -138,10 +139,13 @@ func GenerateAgentID() string {
func ShowVersionInfo(ver string) { func ShowVersionInfo(ver string) {
fmt.Println("Tactical RMM Agent:", ver) fmt.Println("Tactical RMM Agent:", ver)
fmt.Println("Arch:", runtime.GOARCH) fmt.Println("Arch:", runtime.GOARCH)
fmt.Println("Go version:", runtime.Version())
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
fmt.Println("Program Directory:", filepath.Join(os.Getenv("ProgramFiles"), progFilesName)) 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 // TotalRAM returns total RAM in GB