mirror of https://gitlab.com/gitlab-org/cli.git
Merge branch 'gmh-fix-commandless--update-panic' into 'main'
fix: Preventing a panic when not using a sub command Closes #1371 See merge request https://gitlab.com/gitlab-org/cli/-/merge_requests/1304 Merged-by: Jay McCure <jmccure@gitlab.com> Approved-by: Jay McCure <jmccure@gitlab.com> Co-authored-by: Gary Holtz <gholtz@gitlab.com>
This commit is contained in:
commit
c1b3f9ed21
|
@ -162,7 +162,16 @@ func main() {
|
|||
|
||||
checkUpdate, _ := cfg.Get("", "check_update")
|
||||
if checkUpdate, err := strconv.ParseBool(checkUpdate); err == nil && checkUpdate {
|
||||
err = update.CheckUpdate(cmdFactory, version, true, expandedArgs[0])
|
||||
|
||||
var argCommand string
|
||||
|
||||
if expandedArgs != nil {
|
||||
argCommand = expandedArgs[0]
|
||||
} else {
|
||||
argCommand = ""
|
||||
}
|
||||
|
||||
err = update.CheckUpdate(cmdFactory, version, true, argCommand)
|
||||
if err != nil {
|
||||
printError(cmdFactory.IO, err, rootCmd, debug, false)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue