Skip to content

Commit

Permalink
Merge pull request #20 from primeroz/fix-notification
Browse files Browse the repository at this point in the history
Fix notification
  • Loading branch information
primeroz committed Dec 30, 2020
2 parents 83d1926 + 22ab1b4 commit b462797
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion exchange/kraken.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (k *Kraken) Stack(amount float64, fiat string, orderType string, dryRun boo

var orderId string
if dryRun {
orderId = "DryRun"
orderId = "DRY-RUN"
} else {
orderId = strings.Join(order.TransactionIds, ",")
}
Expand Down
9 changes: 6 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,13 @@ func main() {
strings.Title(action),
)

err := nf.Notify(title, result)
// Do not notify if result is not set ( for example if the required args where not specified )
if result != "" {
err := nf.Notify(title, result)

if err != nil {
return cli.Exit(fmt.Sprintf("Notification Error: %s", err), 1)
if err != nil {
return cli.Exit(fmt.Sprintf("Notification Error: %s", err), 1)
}
}

return nil
Expand Down

0 comments on commit b462797

Please sign in to comment.