diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index 30034ec200..d7734e1327 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -38,6 +38,7 @@ module Homebrew def external_commands paths.flat_map { |p| Dir["#{p}/brew-*"] }. + select { |f| File.executable?(f) }. map { |f| File.basename(f, ".rb")[5..-1] }. reject { |f| f =~ /\./ }. sort