improve package gbuild; version updates

This commit is contained in:
John Guo
2022-02-23 12:03:21 +08:00
parent 3db5358dcc
commit 8eb9fdfcd0
4 changed files with 43 additions and 22 deletions

View File

@ -29,8 +29,8 @@ type cVersionOutput struct{}
func (c cVersion) Index(ctx context.Context, in cVersionInput) (*cVersionOutput, error) {
info := gbuild.Info()
if info["git"] == "" {
info["git"] = "none"
if info.Git == "" {
info.Git = "none"
}
mlog.Printf(`GoFrame CLI Tool %s, https://goframe.org`, gf.VERSION)
gfVersion, err := c.getGFVersionOfCurrentProject()
@ -41,7 +41,7 @@ func (c cVersion) Index(ctx context.Context, in cVersionInput) (*cVersionOutput,
}
mlog.Printf(`GoFrame Version: %s`, gfVersion)
mlog.Printf(`CLI Installed At: %s`, gfile.SelfPath())
if info["gf"] == "" {
if info.GoFrame == "" {
mlog.Print(`Current is a custom installed version, no installation information.`)
return nil, nil
}
@ -52,7 +52,7 @@ CLI Built Detail:
GF Version: %s
Git Commit: %s
Build Time: %s
`, info["go"], info["gf"], info["git"], info["time"])))
`, info.Golang, info.GoFrame, info.Git, info.Time)))
return nil, nil
}