run_as_not_developer: use with_env helper

This commit is contained in:
Misty De Meo 2017-07-13 17:26:13 -07:00
parent 890788af65
commit 610af15f0e
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C

View File

@ -287,10 +287,9 @@ ensure
end
def run_as_not_developer(&_block)
old = ENV.delete "HOMEBREW_DEVELOPER"
with_env "HOMEBREW_DEVELOPER" => nil do
yield
ensure
ENV["HOMEBREW_DEVELOPER"] = old
end
end
# Kernel.system but with exceptions