mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
use runtime package to get GOOS and GOARCH
This commit is contained in:
parent
896dda3adf
commit
6473e5ca3c
1 changed files with 2 additions and 4 deletions
6
main.go
6
main.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/app"
|
"github.com/jesseduffield/lazygit/pkg/app"
|
||||||
"github.com/jesseduffield/lazygit/pkg/config"
|
"github.com/jesseduffield/lazygit/pkg/config"
|
||||||
|
@ -15,9 +16,6 @@ var (
|
||||||
commit string
|
commit string
|
||||||
version = "unversioned"
|
version = "unversioned"
|
||||||
date string
|
date string
|
||||||
goos string
|
|
||||||
arch string
|
|
||||||
arm string
|
|
||||||
|
|
||||||
debuggingFlag = flag.Bool("debug", false, "a boolean")
|
debuggingFlag = flag.Bool("debug", false, "a boolean")
|
||||||
versionFlag = flag.Bool("v", false, "Print the current version")
|
versionFlag = flag.Bool("v", false, "Print the current version")
|
||||||
|
@ -46,7 +44,7 @@ func main() {
|
||||||
version = fallbackVersion()
|
version = fallbackVersion()
|
||||||
}
|
}
|
||||||
if *versionFlag {
|
if *versionFlag {
|
||||||
fmt.Printf("commit=%s, build date=%s, version=%s, os=%s, arch=%s, arm=%s\n", commit, date, version, goos, arch, arm)
|
fmt.Printf("commit=%s, build date=%s, version=%s, os=%s, arch=%s\n", commit, date, version, runtime.GOOS, runtime.GOARCH)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
appConfig, err := config.NewAppConfig("lazygit", version, commit, date, debuggingFlag)
|
appConfig, err := config.NewAppConfig("lazygit", version, commit, date, debuggingFlag)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue