Skip to content

Commit

Permalink
从 debug 信息中获取 git commit id
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdhs committed Feb 10, 2024
1 parent ecc3ca2 commit b700ddc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var (
ms bool
v bool
tidy bool
gitHash string
buildDate string
buildOn string
uselang string
Expand Down
2 changes: 2 additions & 0 deletions internal/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ const (
Launcherbrand string = "GML"
Launcherversion string = "1.4.15"
)

var GitHash string
1 change: 1 addition & 0 deletions internal/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b700ddc

Please sign in to comment.