Skip to content

Commit

Permalink
Error if pushover credentials unset
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
  • Loading branch information
charlieegan3 committed Oct 26, 2021
1 parent 4b8c391 commit 7068ecb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/week.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ var weekCmd = &cobra.Command{
pushoverRecipient := psh.NewRecipient(viper.GetString("pushover.user_key"))
pushoverApp := psh.New(viper.GetString("pushover.app_token"))
if alert {
pushover.Notify(pushoverApp, pushoverRecipient, fmt.Sprintf("Weekly Summary (%s)", title), message)
err = pushover.Notify(pushoverApp, pushoverRecipient, fmt.Sprintf("Weekly Summary (%s)", title), message)
} else {
pushover.Notify(pushoverApp, pushoverRecipient, "No Events", "There are no events in the next two weeks")
err = pushover.Notify(pushoverApp, pushoverRecipient, "No Events", "There are no events in the next two weeks")
}
if err != nil {
log.Fatalf("failed to send message: %s", err)
}
},
}
Expand Down

0 comments on commit 7068ecb

Please sign in to comment.