add which method
This commit is contained in:
parent
6868bf0d6e
commit
cc78050dc5
@ -138,6 +138,15 @@ def puts_columns items, star_items=[]
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def which cmd
|
||||||
|
path = `/usr/bin/which #{cmd}`.chomp
|
||||||
|
if path.empty?
|
||||||
|
nil
|
||||||
|
else
|
||||||
|
Pathname.new(path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def which_editor
|
def which_editor
|
||||||
editor = ENV['HOMEBREW_EDITOR'] || ENV['EDITOR']
|
editor = ENV['HOMEBREW_EDITOR'] || ENV['EDITOR']
|
||||||
# If an editor wasn't set, try to pick a sane default
|
# If an editor wasn't set, try to pick a sane default
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user