Skip to content

Commit

Permalink
Merge pull request #488 from tomasc/master
Browse files Browse the repository at this point in the history
replace Open3.popen3 with Open3.capture3
  • Loading branch information
markevans committed Sep 18, 2018
2 parents 3ad0c6d + d597903 commit 7ed572b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/dragonfly/shell.rb
Expand Up @@ -43,12 +43,9 @@ def run_command(command)
else

def run_command(command)
Open3.popen3 command do |stdin, stdout, stderr, wait_thread|
stdin.close_write # make sure it doesn't hang
status = wait_thread.value
raise CommandFailed, "Command failed (#{command}) with exit status #{status.exitstatus} and stderr #{stderr.read}" unless status.success?
stdout.read
end
stdout_str, stderr_str, status = Open3.capture3(command)
raise CommandFailed, "Command failed (#{command}) with exit status #{status.exitstatus} and stderr #{stderr_str}" unless status.success?
stdout_str
end

end
Expand Down

0 comments on commit 7ed572b

Please sign in to comment.