commit f435a9d

Hubert Hirtz  ·  2020-11-30 09:37:25 +0000 UTC
parent 43fbc13
Show command output on failure
1 files changed,  +4, -3
M app.go
M app.go
+4, -3
 1@@ -434,13 +434,14 @@ func (app *App) notifyHighlight(buffer, nick, content string) {
 2 		"%n", nick,
 3 		"%m", cleanMessage(content))
 4 	command := r.Replace(app.cfg.OnHighlight)
 5-	err = exec.Command(sh, "-c", command).Run()
 6+	output, err := exec.Command(sh, "-c", command).CombinedOutput()
 7 	if err != nil {
 8+		body := fmt.Sprintf("Failed to invoke on-highlight command: %v. Output: %q", err, string(output))
 9 		app.win.AddLine(Home, false, ui.Line{
10 			At:        time.Now(),
11-			Head:      "ERROR --",
12+			Head:      "!!",
13 			HeadColor: ui.ColorRed,
14-			Body:      fmt.Sprintf("Failed to invoke on-highlight command: %v", err),
15+			Body:      body,
16 		})
17 	}
18 }