Merge pull request #10280 from hyuraku/cmd/commands_add_only_bash_command_list

cmd/prof: raise error when cmd is bash file
This commit is contained in:
Mike McQuaid 2021-01-18 14:25:21 +00:00 committed by GitHub
commit 668073dfe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,8 @@ module Homebrew
brew_rb = (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path
FileUtils.mkdir_p "prof"
cmd = args.named.first
raise UsageError, "#{cmd} is a Bash command!" if Commands.path(cmd).extname == ".sh"
if args.stackprof?
Homebrew.install_gem_setup_path! "stackprof"