Skip to content

Commit

Permalink
Merge pull request #270 from n00b-bot/main
Browse files Browse the repository at this point in the history
Fix missing return in RunOSCommandStream
  • Loading branch information
j3ssie committed Jan 30, 2024
2 parents eaadf9a + 845ddbf commit 7122db0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ func (r *Runner) RunCommands(commands []string, std string) string {
var out string
if std != "" {
if strings.Contains(std, "/dev/pts") {
err = utils.RunOSCommandStream(command, std)
if err := utils.RunOSCommandStream(command, std); err != nil {
utils.DebugF("error running command: %v -- %v", command, err)
}
return
}
out, err = utils.RunOSCommand(command)
} else {
Expand Down
2 changes: 1 addition & 1 deletion utils/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,9 @@ func RunOSCommandStream(cmd, std string) error {
"-c",
cmd,
}
fmt.Println(std)
file, _ := os.OpenFile(std, os.O_WRONLY, os.ModeAppend)
realCmd := exec.Command(command[0], command[1:]...)
// realCmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}

// output command output to std too
realCmd.Stdout = file
Expand Down

0 comments on commit 7122db0

Please sign in to comment.