Skip to content

Commit 46bbc92

Browse files
committed
* [feat] add option to toggle GitHub version usage in checks
1 parent cc485a8 commit 46bbc92

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cmd/upgrade/q.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ import (
2525
)
2626

2727
type option struct {
28-
log log.Logger
29-
dev bool
28+
log log.Logger
29+
dev bool
30+
useGithub bool
3031
}
3132

3233
func NewUpgradeQ(f factory.Factory) *cobra.Command {
@@ -43,12 +44,17 @@ func NewUpgradeQ(f factory.Factory) *cobra.Command {
4344
},
4445
}
4546
upq.Flags().BoolVarP(&up.dev, "dev", "", false, "upgrade to dev version")
47+
upq.Flags().BoolVarP(&up.useGithub, "github", "", false, "upgrade to github version")
4648
return upq
4749
}
4850

4951
func (up option) DoQcadmin() {
5052
up.log.StartWait("fetch latest version from remote...")
51-
lastVersion, lastType, err := version.PreCheckLatestVersion(up.log, up.dev, "")
53+
st := ""
54+
if up.useGithub {
55+
st = "github"
56+
}
57+
lastVersion, lastType, err := version.PreCheckLatestVersion(up.log, up.dev, st)
5258
up.log.StopWait()
5359
if err != nil {
5460
up.log.Errorf("fetch latest version err, reason: %v", err)

0 commit comments

Comments
 (0)