diff options
| author | Jack Nagel | 2014-07-11 15:51:19 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-11 15:52:39 -0500 |
| commit | 5c24b7330b6a212d68ca1f4def8dfb4ab1b6bb48 (patch) | |
| tree | 475ae778966e0ef87eb86b095c5d14f35596e9ef /Library/Homebrew/utils | |
| parent | 677cd519778ab66e19699d847b03a2f3d958bd2a (diff) | |
| download | brew-5c24b7330b6a212d68ca1f4def8dfb4ab1b6bb48.tar.bz2 | |
Read if no block is passed to Utils.popen_read
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) |
