Skip to content

Commit

Permalink
cmd/vinegar: fetch vcs revision for sysinfo using debug
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Nov 23, 2023
1 parent f575191 commit e2b04ac
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/vinegar/vinegar.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"path/filepath"
"runtime/debug"
"syscall"

"github.com/vinegarhq/vinegar/config"
Expand Down Expand Up @@ -137,14 +138,22 @@ func Sysinfo(pfx *wine.Prefix) {
log.Fatal(err)
}

info := `* Vinegar: %s
var revision string
bi, _ := debug.ReadBuildInfo()
for _, bs := range bi.Settings {
if bs.Key == "vcs.revision" {
revision = fmt.Sprintf("(%s)", bs.Value)
}
}

info := `* Vinegar: %s %s
* Distro: %s
* Processor: %s
* Supports AVX: %t
* Kernel: %s
* Wine: %s`

fmt.Printf(info, Version, sysinfo.Distro, sysinfo.CPU, sysinfo.HasAVX, sysinfo.Kernel, ver)
fmt.Printf(info, Version, revision, sysinfo.Distro, sysinfo.CPU, sysinfo.HasAVX, sysinfo.Kernel, ver)
if sysinfo.InFlatpak {
fmt.Println("* Flatpak: [x]")
}
Expand Down

0 comments on commit e2b04ac

Please sign in to comment.