Skip to content

Commit

Permalink
fix sheel issue (#143)
Browse files Browse the repository at this point in the history
Signed-off-by: 6za <53096417+6za@users.noreply.github.com>
  • Loading branch information
6za committed Jul 21, 2022
1 parent 2b01c13 commit db9f6d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ func ExecShellWithVars(osvars map[string]string, command string, args ...string)
}

// Not meant to be exported, for internal use only.
func reader(scanner *bufio.Scanner, out chan string) {
for scanner.Scan() {
func reader(scanner *bufio.Scanner, out chan string) {
defer func() {
if r := recover(); r != nil {
log.Println("Error processing logs from command. Error:\n", r)
}
}()
for scanner.Scan() {
out <- scanner.Text()
}
}

0 comments on commit db9f6d9

Please sign in to comment.