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

pull/708/head
Matt Butcher 8 years ago
parent 5e1ef0ce86
commit 6235bf5085

@ -1,6 +1,7 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"strings" "strings"
@ -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 {
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)
} }

Loading…
Cancel
Save