pkg/cmd/root: fix startup panic (#8105)
This commit is contained in:
parent
b4d075ef00
commit
07ee387f25
1 changed files with 2 additions and 1 deletions
|
|
@ -72,7 +72,8 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) (*cobra.Command,
|
|||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
// require that the user is authenticated before running most commands
|
||||
if cmdutil.IsAuthCheckEnabled(cmd) && !cmdutil.CheckAuth(cfg) {
|
||||
if cmd.Parent().Use == "codespace" {
|
||||
parent := cmd.Parent()
|
||||
if parent != nil && parent.Use == "codespace" {
|
||||
fmt.Fprintln(io.ErrOut, "To get started with GitHub CLI, please run: gh auth login -s codespace")
|
||||
} else {
|
||||
fmt.Fprint(io.ErrOut, authHelp())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue