aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/popen.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils/popen.rb')
-rw-r--r--Library/Homebrew/utils/popen.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/Library/Homebrew/utils/popen.rb b/Library/Homebrew/utils/popen.rb
index 76e67b3a9..350d9a09f 100644
--- a/Library/Homebrew/utils/popen.rb
+++ b/Library/Homebrew/utils/popen.rb
@@ -14,11 +14,8 @@ module Utils
def self.popen(args, mode)
IO.popen("-", mode) do |pipe|
if pipe
- if block_given?
- yield pipe
- else
- return pipe.read
- end
+ return pipe.read unless block_given?
+ yield pipe
else
$stderr.reopen("/dev/null", "w")
exec(*args)