diff --git a/cmd/utils/bash_commands.go b/cmd/utils/bash_commands.go index ae3e1078..2632e468 100644 --- a/cmd/utils/bash_commands.go +++ b/cmd/utils/bash_commands.go @@ -7,6 +7,7 @@ import ( "io" "os" "os/exec" + "strings" "time" "github.com/dymensionxyz/roller/config" @@ -74,17 +75,12 @@ func RunBashCmdAsync(cmd *exec.Cmd, printOutput func(), parseError func(errMsg s } func ExecBashCommandWithStdout(cmd *exec.Cmd) (bytes.Buffer, error) { - nullFile, err := os.Open(os.DevNull) - if err != nil { - return bytes.Buffer{}, err - } - defer nullFile.Close() - cmd.Stdin = nullFile + cmd.Stdin = strings.NewReader("\n") var stderr bytes.Buffer var stdout bytes.Buffer cmd.Stderr = &stderr cmd.Stdout = &stdout - err = cmd.Run() + err := cmd.Run() if err != nil { return stdout, fmt.Errorf("command execution failed: %w, stderr: %s", err, stderr.String()) }