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:
parent
d5f2cdd31c
commit
2056e24a12
@ -269,7 +269,7 @@ module MacOS extend self
|
|||||||
end
|
end
|
||||||
|
|
||||||
def mdfind attribute, id
|
def mdfind attribute, id
|
||||||
path = `mdfind "#{attribute} == '#{id}'"`.strip
|
path = `mdfind "#{attribute} == '#{id}'"`.split("\n").first.strip
|
||||||
Pathname.new(path) unless path.empty?
|
Pathname.new(path) unless path.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user