Skip to content

Commit

Permalink
fix(version): fix version show
Browse files Browse the repository at this point in the history
fix version show

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed Sep 12, 2023
1 parent eb4e5c0 commit b1cf326
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions cmd/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"time"

"github.com/easysoft/qcadmin/internal/app/config"
"github.com/ergoapi/util/file"
"github.com/ergoapi/util/github"

gv "github.com/Masterminds/semver/v3"
Expand Down Expand Up @@ -196,16 +197,18 @@ func ShowVersion(log logpkg.Logger) {
}
}

cfg, _ := config.LoadConfig()
if cfg != nil {
vd.Server.ServerType = cfg.Quickon.Type
if cfg.Quickon.DevOps {
vd.Server.ServerType = common.QuickonType(fmt.Sprintf("devops.%s", vd.Server.ServerType))
}

qv, err := upgrade.QuchengVersion(cfg.Quickon.DevOps)
if err == nil {
vd.Server.Components = &qv
if file.CheckFileExists(common.GetCustomConfig(common.InitFileName)) {
cfg, _ := config.LoadConfig()
if cfg != nil {
vd.Server.ServerType = cfg.Quickon.Type
if cfg.Quickon.DevOps {
vd.Server.ServerType = common.QuickonType(fmt.Sprintf("devops.%s", vd.Server.ServerType))
}

qv, err := upgrade.QuchengVersion(cfg.Quickon.DevOps)
if err == nil {
vd.Server.Components = &qv
}
}
}
if err := prettyPrintVersion(vd, tmpl); err != nil {
Expand Down

0 comments on commit b1cf326

Please sign in to comment.