Permalink
Browse files

use hash instead of which for more portable ask_editor

  • Loading branch information...
fgalassi committed Feb 17, 2012
1 parent 3b70354 commit 0003b5a5b64a5536cb89392f5fb085d613a00727
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/commander/user_interaction.rb
@@ -234,7 +234,7 @@ def reset_io
def available_editor preferred = nil
[preferred, ENV['EDITOR'], 'mate -w', 'vim', 'vi', 'emacs', 'nano', 'pico'].
compact.
- find {|name| system("/usr/bin/which #{name.split.first} > /dev/null") }
+ find {|name| system("hash #{name.split.first} 2>&-") }
end
##

0 comments on commit 0003b5a

Please sign in to comment.