aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2014-07-09 16:48:17 -0500
committerJack Nagel2014-07-09 17:04:52 -0500
commit5ab16295e50b84952df32c1fbc7dc557ddb695b7 (patch)
tree5699de62067ab3e0582e914bc7a12377c5aa3a6d /Library/Homebrew/cmd
parent7ee49db51e27b4403d3f24747262d9c9891c8477 (diff)
downloadbrew-5ab16295e50b84952df32c1fbc7dc557ddb695b7.tar.bz2
Fix getting filesystem mounts
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/doctor.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 3d5959ad2..5f385556e 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -27,12 +27,17 @@ class Volumes
def get_mounts path=nil
vols = []
# get the volume of path, if path is nil returns all volumes
- raw_df = Utils.popen_read("/bin/df", "-P", path, &:read)
- raw_df.split("\n").each do |line|
- case line
- # regex matches: /dev/disk0s2 489562928 440803616 48247312 91% /
- when /^(.*)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]{1,3}\%)\s+(.*)/
- vols << $6
+
+ args = %w[/bin/df -P]
+ args << path if path
+
+ Utils.popen_read(*args) do |io|
+ io.each_line do |line|
+ case line.chomp
+ # regex matches: /dev/disk0s2 489562928 440803616 48247312 91% /
+ when /^(.*)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]{1,3}\%)\s+(.*)/
+ vols << $6
+ end
end
end
return vols