diff options
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/popen.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/popen.rb b/Library/Homebrew/utils/popen.rb index 83f140163..1463df530 100644 --- a/Library/Homebrew/utils/popen.rb +++ b/Library/Homebrew/utils/popen.rb @@ -10,7 +10,11 @@ module Utils def self.popen(args, mode) IO.popen("-", mode) do |pipe| if pipe - yield pipe + if block_given? + yield pipe + else + return pipe.read + end else STDERR.reopen("/dev/null", "w") exec(*args) |
