Skip to content

Commit

Permalink
Move it
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimedrolity committed Dec 6, 2022
1 parent 29b8133 commit c247489
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions notifier/senders/script/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ type Sender struct {

// NewSender creates Sender instance.
func NewSender(senderSettings map[string]string, logger moira.Logger) (*Sender, error) {
sender := &Sender{}

if senderSettings["name"] == "" {
return nil, fmt.Errorf("required name for sender type script")
}
_, _, err := parseExec(senderSettings["exec"])
if err != nil {
return nil, err
}
sender.exec = senderSettings["exec"]
sender.logger = logger

sender := &Sender{
exec: senderSettings["exec"],
logger: logger,
}

return sender, nil
}
Expand Down

0 comments on commit c247489

Please sign in to comment.