From 001b55f73aa5fdf5d5f10e14589f45abafa57a6d Mon Sep 17 00:00:00 2001 From: AlejandroSuero Date: Sun, 8 Sep 2024 15:11:15 +0200 Subject: [PATCH] refactor: `input` as `out` to match `executeCommand` Also prints new line after error status. --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index f6dbd4e..881a8d4 100644 --- a/main.go +++ b/main.go @@ -83,15 +83,15 @@ func main() { // Copy the pty output to buffer if config.Execute != "" { - input, err = executeCommand(config) + out, err := executeCommand(config) if err != nil { - if input != "" { + if out != "" { // show the full error message output - err = fmt.Errorf("%w %s", err, input) + err = fmt.Errorf("%w\n%s", err, out) } printErrorFatal("Something went wrong", err) } - if input == "" { + if out == "" { printErrorFatal("Something went wrong", errors.New("no command output")) } }