Don't allow sudo brew upgrade if not sensible
This commit is contained in:
parent
a13ff43886
commit
6988a75b84
@ -9,6 +9,12 @@ end
|
||||
|
||||
module Homebrew extend self
|
||||
def upgrade
|
||||
if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
|
||||
# note we only abort if Homebrew is *not* installed as sudo and the user
|
||||
# calls brew as root. The fix is to chown brew to root.
|
||||
abort "Cowardly refusing to `sudo brew upgrade'"
|
||||
end
|
||||
|
||||
Homebrew.perform_preinstall_checks
|
||||
|
||||
outdated = if ARGV.named.empty?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user