Permalink
Browse files

add emoji to run success or fail

  • Loading branch information...
justone committed Jul 20, 2016
1 parent b94c4eb commit 0293073fe81e480698d1a8195b47f787328f6491
Showing with 4 additions and 2 deletions.
  1. +4 −2 run.go
6 run.go
@@ -92,16 +92,18 @@ func runRun(conn *pmb.Connection, id string, args []string) error {
cmdSuccess := true
result := "successfully"
resultEmoji := "👍"
if err != nil {
result = fmt.Sprintf("with error '%s'", err.Error())
resultEmoji = "👎"
cmdSuccess = false
}
logrus.Infof("Process complete.")
if len(message) == 0 {
message = fmt.Sprintf("Command [%s] completed %s.", command, result)
message = fmt.Sprintf("%s Command [%s] completed %s.", resultEmoji, command, result)
} else {
message = fmt.Sprintf("%s. Command completed %s.", message, result)
message = fmt.Sprintf("%s. %s Command completed %s.", message, resultEmoji, result)
}
note := pmb.Notification{Message: message, Level: runCommand.Level}

0 comments on commit 0293073

Please sign in to comment.