diff options
| author | Xu Cheng | 2015-03-05 18:05:07 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-03-06 22:19:24 +0800 |
| commit | 144453368ed42c13e24143dd4e234795eb67f3cb (patch) | |
| tree | b45ba9719bbc6e2c1fdf431c4bdb9b4f34ed1078 /Library/Homebrew/extend | |
| parent | 4d5c1526665bda7ccd3948e388bec27001ddd1e7 (diff) | |
| download | brew-144453368ed42c13e24143dd4e234795eb67f3cb.tar.bz2 | |
test-bot pathname: use Utils.popen_read instead of backticks
Closes Homebrew/homebrew#37418.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 2ca8b6e5f..6e7a8ef58 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -413,10 +413,11 @@ class Pathname end def abv - out='' - n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i + out = "" + n = Utils.popen_read("find", expand_path.to_s, "-type", "f", "!", "-name", ".DS_Store").split("\n").size out << "#{n} files, " if n > 1 - out << `/usr/bin/du -hs #{to_s} | cut -d"\t" -f1`.strip + out << Utils.popen_read("/usr/bin/du", "-hs", expand_path.to_s).split("\t")[0] + out end # We redefine these private methods in order to add the /o modifier to |
