diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 4e8da3c247..f78fbfcb7f 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -337,6 +337,14 @@ ensure ENV["PATH"] = old_path end +def with_custom_locale(locale) + old_locale = ENV["LC_ALL"] + ENV["LC_ALL"] = locale + yield +ensure + ENV["LC_ALL"] = old_locale +end + def run_as_not_developer(&_block) old = ENV.delete "HOMEBREW_DEVELOPER" yield