From b700ddcf156bc851d2e17909a75c992cd1cfa989 Mon Sep 17 00:00:00 2001 From: xmdhs Date: Sun, 11 Feb 2024 02:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8E=20debug=20=E4=BF=A1=E6=81=AF=E4=B8=AD?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=20git=20commit=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flag.go | 1 - internal/info.go | 2 ++ internal/unit.go | 1 + main.go | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/flag.go b/flag.go index 7bc8bf1..221f2cd 100644 --- a/flag.go +++ b/flag.go @@ -23,7 +23,6 @@ var ( ms bool v bool tidy bool - gitHash string buildDate string buildOn string uselang string diff --git a/internal/info.go b/internal/info.go index 5fe922e..265a577 100644 --- a/internal/info.go +++ b/internal/info.go @@ -4,3 +4,5 @@ const ( Launcherbrand string = "GML" Launcherversion string = "1.4.15" ) + +var GitHash string diff --git a/internal/unit.go b/internal/unit.go index 839b1bf..a1e1522 100644 --- a/internal/unit.go +++ b/internal/unit.go @@ -35,6 +35,7 @@ func init() { } } ua = fmt.Sprintf("gomclauncher/%s (%v)", Launcherversion, hash) + GitHash = hash } func HttpGet(cxt context.Context, aurl string, t *http.Transport, header http.Header) (*http.Response, *time.Timer, error) { diff --git a/main.go b/main.go index e5ae66c..86de997 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/xmdhs/gomclauncher/auth" aflag "github.com/xmdhs/gomclauncher/flag" + "github.com/xmdhs/gomclauncher/internal" "github.com/xmdhs/gomclauncher/lang" "github.com/xmdhs/gomclauncher/launcher" ) @@ -141,7 +142,7 @@ func checkByDns() (string, error) { } func version() { - fmt.Println("gomclauncher-" + launcher.Launcherversion + "-" + gitHash) + fmt.Println("gomclauncher-" + internal.Launcherversion + "-" + internal.GitHash) fmt.Println("Build date: " + buildDate) fmt.Println("Build on: " + buildOn) fmt.Println("Repository: https://github.com/xmdhs/gomclauncher")