mdfind: Handle multiple results

Turns out mdfind can return multiple results on the commandline, if
more than one app bundle matches.

Fixes Homebrew/homebrew#13789.
This commit is contained in:
Misty De Meo 2012-07-30 23:20:05 -03:00
parent d5f2cdd31c
commit 2056e24a12

View File

@ -269,7 +269,7 @@ module MacOS extend self
end
def mdfind attribute, id
path = `mdfind "#{attribute} == '#{id}'"`.strip
path = `mdfind "#{attribute} == '#{id}'"`.split("\n").first.strip
Pathname.new(path) unless path.empty?
end