Commit 6235bf50 authored by Matt Butcher's avatar Matt Butcher

fix(helm): print msg and exit when list has no results

parent 5e1ef0ce
package main package main
import ( import (
"errors"
"fmt" "fmt"
"strings" "strings"
...@@ -62,6 +63,8 @@ func init() { ...@@ -62,6 +63,8 @@ func init() {
RootCommand.AddCommand(listCommand) RootCommand.AddCommand(listCommand)
} }
var errListNoReleases = errors.New("no releases found")
func listCmd(cmd *cobra.Command, args []string) error { func listCmd(cmd *cobra.Command, args []string) error {
var filter string var filter string
if len(args) > 0 { if len(args) > 0 {
...@@ -83,6 +86,10 @@ func listCmd(cmd *cobra.Command, args []string) error { ...@@ -83,6 +86,10 @@ func listCmd(cmd *cobra.Command, args []string) error {
return prettyError(err) return prettyError(err)
} }
if len(res.Releases) == 0 {
return errListNoReleases
}
if res.Next != "" { if res.Next != "" {
fmt.Printf("\tnext: %s", res.Next) fmt.Printf("\tnext: %s", res.Next)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment