aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 955c1e8f2..a6b093acc 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -99,6 +99,14 @@ module Homebrew
end
end
+def with_system_path
+ old_path = ENV['PATH']
+ ENV['PATH'] = '/usr/bin:/bin'
+ yield
+ensure
+ ENV['PATH'] = old_path
+end
+
# Kernel.system but with exceptions
def safe_system cmd, *args
unless Homebrew.system cmd, *args