caveats: handle non-Homebrew plists.

Mentioned in Homebrew/homebrew#34484.
This commit is contained in:
Mike McQuaid 2014-11-27 10:48:24 +00:00
parent 6017811397
commit b89bacb9c9

View File

@ -108,7 +108,11 @@ class Caveats
destination = f.plist_startup ? '/Library/LaunchDaemons' \
: '~/Library/LaunchAgents'
plist_filename = f.plist_path.basename
plist_filename = if f.plist
f.plist_path.basename
else
File.basename Dir["#{keg.to_path}/*.plist"].first
end
plist_link = "#{destination}/#{plist_filename}"
plist_domain = f.plist_path.basename('.plist')
destination_path = Pathname.new File.expand_path destination