apply which to default editor values

this was lost during integration from Homebrew
This commit is contained in:
Roland Walker 2015-01-13 07:07:10 -05:00
parent 6da1aee8fc
commit dbfe0db2de

View file

@ -133,8 +133,10 @@ module Hbc::Utils
end
def self.exec_editor(*args)
editor = [ *ENV.values_at('HOMEBREW_EDITOR', 'VISUAL', 'EDITOR'),
*%w{mate edit vim /usr/bin/vim} ].compact.first
editor = [
*ENV.values_at('HOMEBREW_EDITOR', 'VISUAL', 'EDITOR'),
*%w{mate edit vim /usr/bin/vim}.map{ |x| which(x) }
].compact.first.to_s
exec(*editor.split.concat(args))
end