Revert "feat(config): swap viper and cobra for config (#684)"

This reverts commit ff8cb884a0.
This commit is contained in:
Simon Aronsson 2020-12-21 23:08:23 +01:00
parent 89119515af
commit 8b81fbd48d
No known key found for this signature in database
GPG key ID: 8DA57A5FD341605B
12 changed files with 255 additions and 229 deletions

View file

@ -5,7 +5,6 @@ import (
"github.com/johntdyer/slackrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
const (
@ -16,13 +15,14 @@ type slackTypeNotifier struct {
slackrus.SlackrusHook
}
func newSlackNotifier(_ *cobra.Command, acceptedLogLevels []log.Level) t.Notifier {
func newSlackNotifier(c *cobra.Command, acceptedLogLevels []log.Level) t.Notifier {
flags := c.PersistentFlags()
hookURL := viper.GetString("notification-slack-hook-url")
userName := viper.GetString("notification-slack-identifier")
channel := viper.GetString("notification-slack-channel")
emoji := viper.GetString("notification-slack-icon-emoji")
iconURL := viper.GetString("notification-slack-icon-url")
hookURL, _ := flags.GetString("notification-slack-hook-url")
userName, _ := flags.GetString("notification-slack-identifier")
channel, _ := flags.GetString("notification-slack-channel")
emoji, _ := flags.GetString("notification-slack-icon-emoji")
iconURL, _ := flags.GetString("notification-slack-icon-url")
n := &slackTypeNotifier{
SlackrusHook: slackrus.SlackrusHook{