diff options
| author | Mike McQuaid | 2013-03-10 17:03:17 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-03-11 18:26:25 +0000 |
| commit | 9837bbda550a45b7748f7d888c2b25d5a73abc03 (patch) | |
| tree | 9251674668cff8a0687f7d9953bbbb799d3d24b9 /Library/Homebrew/utils.rb | |
| parent | d39280bdf7aca09ea7c6d9acf927bd95b6d1e499 (diff) | |
| download | brew-9837bbda550a45b7748f7d888c2b25d5a73abc03.tar.bz2 | |
Add with_system_path to run using system PATHs.
Needed for Linux compatibility.
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 8 |
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 |
