cmd/commands: add_only_bash_command_list

This commit is contained in:
hyuraku 2021-01-10 23:03:13 +09:00
parent 5844fc4f00
commit e896c5c4cf
2 changed files with 6 additions and 0 deletions

View File

@ -131,6 +131,8 @@ begin
end
exec "brew-#{cmd}", *ARGV
else
raise "command made by bash not ruby: #{cmd}" if Commands.only_bash_command_list.include?(cmd)
possible_tap = OFFICIAL_CMD_TAPS.find { |_, cmds| cmds.include?(cmd) }
possible_tap = Tap.fetch(possible_tap.first) if possible_tap

View File

@ -197,4 +197,8 @@ module Commands
file = HOMEBREW_CACHE/"all_commands_list.txt"
file.atomic_write("#{commands(aliases: true).sort.join("\n")}\n")
end
def only_bash_command_list
internal_commands.reject { |cmd| valid_internal_cmd?(cmd) }
end
end