From 2063e0fc523ab780e41ae829c04773fa21827abb Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Wed, 18 Oct 2017 11:34:33 +0100 Subject: [PATCH] commands: filter out dotfiles from output --- Library/Homebrew/cmd/commands.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index a3527bc94c..13395a8c20 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -52,7 +52,10 @@ module Homebrew def find_internal_commands(directory) directory.children.each_with_object([]) do |f, cmds| - cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file? + if f.file? + next if f.basename.to_s =~ /^\./ + cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") + end end end end