|
|
@ -38,8 +38,8 @@ func newRepoListCmd(out io.Writer) *cobra.Command {
|
|
|
|
Args: require.NoArgs,
|
|
|
|
Args: require.NoArgs,
|
|
|
|
ValidArgsFunction: noCompletions,
|
|
|
|
ValidArgsFunction: noCompletions,
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
f, err := repo.LoadFile(settings.RepositoryConfig)
|
|
|
|
f, _ := repo.LoadFile(settings.RepositoryConfig)
|
|
|
|
if isNotExist(err) || (len(f.Repositories) == 0 && !(outfmt == output.JSON || outfmt == output.YAML)) {
|
|
|
|
if len(f.Repositories) == 0 && !(outfmt == output.JSON || outfmt == output.YAML) {
|
|
|
|
return errors.New("no repositories to show")
|
|
|
|
return errors.New("no repositories to show")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|