Also, print as a warning to STDERR and print a backtrace in debug mode.
ClosesHomebrew/homebrew#47099.
ClosesHomebrew/homebrew#47154.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Make both `--version` and `-v` print the Homebrew version and exit, if
provided as first and sole argument. `brew --version` no longer accepts
additional arguments (they were previously ignored). Otherwise interpret
`brew -v <arguments>` as if `brew <arguments> -v` was executed instead
(no change here), but no longer print a line with the Homebrew version.
ClosesHomebrew/homebrew#46790.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
`reinstall` can currently be executed under sudo and has every chunk of problems
running install under sudo does when `brew` isn't root owned.
Likewise with `postinstall` which we increasingly use to create directories and
move/install files elsewhere. Using sudo there both masks deeper issues and
makes uninstall troublesome.
ClosesHomebrew/homebrew#45112.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
The xcrun code is stolen right out of the INSTALL script.
Check for user agreement of the Xcode license before permitting any other brew usage to continue.
This prevents the situation where people are instructed to "please re-run as root via sudo" on brew commands.
The check can only fail when Xcode is installed & the active developer dir.
ClosesHomebrew/homebrew#44974.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This is unnecessary here because we use it only once. The difference
won't be noticeable but the check is ~5 times faster now.
ClosesHomebrew/homebrew#40901.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Issue a warning about Homebrew's very basic support for 10.11 at this point
in time on each run of `brew`.
ClosesHomebrew/homebrew#40536.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Don't match `help` at the end of every string because `brew installhelp`
shouldn't really be running help.
ClosesHomebrew/homebrew#36559.
ClosesHomebrew/homebrew#36576.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This means that taps root and `cmd` directories are added to the PATH.
This should enable migration of some of our contributed commands into
taps (e.g. `homebrew-boneyard`) and make it easy for third parties to
be able to maintain these. It might also make stuff easier for existing
tools like e.g. `brew-cask` and `boxen`.
ClosesHomebrew/homebrew#32471.
Let's check for e.g. --help anywhere in the ARGV array rather than just
the first value to avoid brew upgrade --help causing problems.
ClosesHomebrew/homebrew#26675.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Since a bad xcode-select path can cause many brew commands to freeze,
it's worth warning users and bailing out as early as possible.
The doctor check wasn't good enough, since the doctor could freeze
before the warning about this was ever printed.