diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/utils.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 8bd2537e5..0dd26d49b 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -80,3 +80,15 @@ def puts_columns items, cols = 4 width=`stty size`.chomp.split(" ").last IO.popen("pr -#{cols} -t", "w"){|io| io.write(items) } end + +def exec_editor *args + editor=ENV['EDITOR'] + if editor.nil? + if system "which -s mate" and $?.success? + editor='mate' + else + editor='vim' + end + end + exec editor, *args +end |
