update for globally accesible version number

This commit is contained in:
Matt Spurrier 2024-03-30 21:24:30 +08:00
parent ee45d29e6f
commit 9a8e1002cd
3 changed files with 13 additions and 2 deletions

View file

@ -16,11 +16,11 @@ builds:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
mod_timestamp: "{{ .CommitTimestamp }}"
ldflags:
- -s -w -X version.Version={{.Version}}
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.

View file

@ -1,15 +1,23 @@
package main
import (
"fmt"
internal "github.com/HikariKnight/quickpassthrough/internal"
downloader "github.com/HikariKnight/quickpassthrough/internal/ls_iommu_downloader"
"github.com/HikariKnight/quickpassthrough/internal/params"
"github.com/HikariKnight/quickpassthrough/internal/version"
)
func main() {
// Get all our arguments in 1 neat struct
pArg := params.NewParams()
// Display the version
if p.Arg.Flag["version"] {
fmt.Printf("QuickPassthrough Version %s\n", version.Version)
}
if !pArg.Flag["gui"] {
downloader.CheckLsIOMMU()
internal.Tui()

View file

@ -0,0 +1,3 @@
package version
type Version string