Skip to content

Commit

Permalink
Change success message
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandowner committed Nov 18, 2023
1 parent 20def17 commit 15c7a52
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ func (o *option) HelmBin() string {
return "helm"
}

func (o *option) OK() string {
if o.UpdateSnapshot {
return "updated"
}
return "matched"
}

func main() {
rootCmd := &cobra.Command{
Use: "chartsnap -c CHART",
Expand Down Expand Up @@ -271,15 +278,15 @@ func run(cmd *cobra.Command, args []string) error {
fmt.Println(failureMessage)
return fmt.Errorf("snapshot does not match chart=%s values=%s", ht.Chart, ht.ValuesFile)
}
bannerPrintln("PASS", fmt.Sprintf("Snapshot matched chart=%s values=%s", ht.Chart, ht.ValuesFile), color.FgGreen, color.BgGreen)
bannerPrintln("PASS", fmt.Sprintf("Snapshot %s chart=%s values=%s", o.OK(), ht.Chart, ht.ValuesFile), color.FgGreen, color.BgGreen)
return nil
})
}

if err := eg.Wait(); err != nil {
return err
}
bannerPrintln("PASS", "All snapshot matched", color.FgGreen, color.BgGreen)
bannerPrintln("PASS", fmt.Sprintf("All snapshots %s", o.OK()), color.FgGreen, color.BgGreen)

return nil
}
Expand Down

0 comments on commit 15c7a52

Please sign in to comment.