Only error out for sudo brew install
Note this only happens if Homebrew is *not* installed sudo. Which is most of the time true. Fixes Homebrew/homebrew#6899
This commit is contained in:
parent
32c746ef45
commit
df113d3ce6
@ -9,6 +9,12 @@ module Homebrew extend self
|
||||
raise "No available formula for #{name}\n#{msg}" if msg
|
||||
end unless ARGV.force?
|
||||
|
||||
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 install'"
|
||||
end
|
||||
|
||||
install_formulae ARGV.formulae
|
||||
end
|
||||
|
||||
|
||||
5
bin/brew
5
bin/brew
@ -26,11 +26,6 @@ when '-v'
|
||||
end
|
||||
end
|
||||
|
||||
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'"
|
||||
end
|
||||
case HOMEBREW_PREFIX.to_s when '/', '/usr'
|
||||
# it may work, but I only see pain this route and don't want to support it
|
||||
abort "Cowardly refusing to continue at this prefix: #{HOMEBREW_PREFIX}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user