Skip to content

Commit

Permalink
fix: input must be set in --execute
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Nov 15, 2024
1 parent f6e8436 commit 440bc50
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,14 @@ func main() {

// Copy the pty output to buffer
if config.Execute != "" {
out, err := executeCommand(config)
input, err = executeCommand(config)
if err != nil {
if out != "" {
// show the full error message output
err = fmt.Errorf("%w\n%s", err, out)
if input != "" {
err = fmt.Errorf("%w\n%s", err, input)
}
printErrorFatal("Something went wrong", err)
}
if out == "" {
if input == "" {
printErrorFatal("Something went wrong", errors.New("no command output"))
}
}
Expand Down

0 comments on commit 440bc50

Please sign in to comment.