update for globally accesible version number
This commit is contained in:
parent
ee45d29e6f
commit
9a8e1002cd
3 changed files with 13 additions and 2 deletions
|
@ -16,11 +16,11 @@ builds:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
|
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||||
|
ldflags:
|
||||||
|
- -s -w -X version.Version={{.Version}}
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- format: tar.gz
|
||||||
# this name template makes the OS and Arch compatible with the results of `uname`.
|
# this name template makes the OS and Arch compatible with the results of `uname`.
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
internal "github.com/HikariKnight/quickpassthrough/internal"
|
internal "github.com/HikariKnight/quickpassthrough/internal"
|
||||||
downloader "github.com/HikariKnight/quickpassthrough/internal/ls_iommu_downloader"
|
downloader "github.com/HikariKnight/quickpassthrough/internal/ls_iommu_downloader"
|
||||||
"github.com/HikariKnight/quickpassthrough/internal/params"
|
"github.com/HikariKnight/quickpassthrough/internal/params"
|
||||||
|
"github.com/HikariKnight/quickpassthrough/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Get all our arguments in 1 neat struct
|
// Get all our arguments in 1 neat struct
|
||||||
pArg := params.NewParams()
|
pArg := params.NewParams()
|
||||||
|
|
||||||
|
// Display the version
|
||||||
|
if p.Arg.Flag["version"] {
|
||||||
|
fmt.Printf("QuickPassthrough Version %s\n", version.Version)
|
||||||
|
}
|
||||||
|
|
||||||
if !pArg.Flag["gui"] {
|
if !pArg.Flag["gui"] {
|
||||||
downloader.CheckLsIOMMU()
|
downloader.CheckLsIOMMU()
|
||||||
internal.Tui()
|
internal.Tui()
|
||||||
|
|
3
internal/version/version.go
Normal file
3
internal/version/version.go
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
package version
|
||||||
|
|
||||||
|
type Version string
|
Loading…
Add table
Add a link
Reference in a new issue