gh extensions list: Don't error if no extensions installed (#5445)

This commit is contained in:
Roshan Padaki 2022-04-13 03:31:24 -04:00 committed by GitHub
parent 868a03c0ca
commit 8f046e0b77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,7 +47,9 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
cmds := m.List()
if len(cmds) == 0 {
return errors.New("no extensions installed")
cs := io.ColorScheme()
fmt.Fprintf(io.ErrOut, "%s No installed extensions found\n", cs.WarningIcon())
return nil
}
cs := io.ColorScheme()
t := utils.NewTablePrinter(io)
@ -80,10 +82,10 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
Short: "Install a gh extension from a repository",
Long: heredoc.Doc(`
Install a GitHub repository locally as a GitHub CLI extension.
The repository argument can be specified in "owner/repo" format as well as a full URL.
The URL format is useful when the repository is not hosted on github.com.
To install an extension in development from the current directory, use "." as the
value of the repository argument.