Reuse code from `brew doctor` that checks and produces a fatal error and from `install.rb` that runs it. Closes #8646
ENV
Git
Homebrew.args
Context