diff options
| author | Mike McQuaid | 2017-10-20 11:01:27 +0100 |
|---|---|---|
| committer | GitHub | 2017-10-20 11:01:27 +0100 |
| commit | a2374cba6cf9a56897f5feeab7f4add661d3c287 (patch) | |
| tree | 44f3922563b9f2710f75d79f528d05055034014f /Library | |
| parent | 460048bcb6da5afdc20947676ec288943c1d720f (diff) | |
| parent | 59238cd343630104f53b56565f039391d08abd6a (diff) | |
| download | brew-a2374cba6cf9a56897f5feeab7f4add661d3c287.tar.bz2 | |
Merge pull request #3334 from DomT4/ds_store_is_not_a_command
commands: filter out dotfiles from output
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/commands.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index a3527bc94..0dfc6c451 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -51,8 +51,8 @@ module Homebrew end def find_internal_commands(directory) - directory.children.each_with_object([]) do |f, cmds| - cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file? - end + Pathname.glob(directory/"*") + .select(&:file?) + .map { |f| f.basename.to_s.sub(/\.(?:rb|sh)$/, "") } end end |
