Allows turning off sudo usage with an ENV variable

This commit is contained in:
Evan Sharp 2010-01-07 14:33:02 -05:00
parent e3a92c68e4
commit 289c338e34

View File

@ -33,6 +33,7 @@
# on win32, cygwin, or mingw32 or they ask us not to # on win32, cygwin, or mingw32 or they ask us not to
def use_sudo? def use_sudo?
return false if RUBY_PLATFORM =~ /(win|w)32$/ # true if win32, cygwin or mingw32 return false if RUBY_PLATFORM =~ /(win|w)32$/ # true if win32, cygwin or mingw32
return false if ENV['NO_SUDO'] =~ /true/i
return true return true
end end