Inline error message
This commit is contained in:
parent
d85f2dabca
commit
d4c8f83381
@ -107,9 +107,3 @@ HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/homebrew(-[\
|
||||
require 'compat' unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']
|
||||
|
||||
ORIGINAL_PATHS = ENV['PATH'].split(File::PATH_SEPARATOR).map{ |p| Pathname.new(p).expand_path rescue nil }.compact.freeze
|
||||
|
||||
SUDO_BAD_ERRMSG = <<-EOS.undent
|
||||
You can use brew with sudo, but only if the brew executable is owned by root.
|
||||
However, this is both not recommended and completely unsupported so do so at
|
||||
your own risk.
|
||||
EOS
|
||||
|
||||
@ -102,7 +102,12 @@ begin
|
||||
|
||||
if sudo_check.include? cmd
|
||||
if Process.uid.zero? and not File.stat(HOMEBREW_BREW_FILE).uid.zero?
|
||||
raise "Cowardly refusing to `sudo brew #{cmd}`\n#{SUDO_BAD_ERRMSG}"
|
||||
raise <<-EOS.undent
|
||||
Cowardly refusing to `sudo brew #{cmd}`
|
||||
You can use brew with sudo, but only if the brew executable is owned by root.
|
||||
However, this is both not recommended and completely unsupported so do so at
|
||||
your own risk.
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user