aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2014-07-03 20:50:04 +0800
committerMike McQuaid2014-08-31 19:18:11 +0100
commitf2d92e86c08e002ed9c22026ed14bd1b6bb32414 (patch)
tree22fbdba38460b4325049e5694f199d77738d4ee2 /Library
parent0ed263faf3735d0958d9a447c561bf3db51c42e4 (diff)
downloadhomebrew-f2d92e86c08e002ed9c22026ed14bd1b6bb32414.tar.bz2
plist_caveats: simplify the block and add a comment
Closes #30630. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/caveats.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index 1973dff42..fa37c6289 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -104,22 +104,20 @@ class Caveats
else
s << " launchctl load #{plist_link}"
end
- else
- if f.plist_startup
+ # For startup plists, we cannot tell whether it's running on launchd,
+ # as it requires for `sudo launchctl list` to get real result.
+ elsif f.plist_startup
s << "To reload #{f.name} after an upgrade:"
s << " sudo launchctl unload #{plist_link}"
s << " sudo cp -fv #{f.opt_prefix}/*.plist #{destination}"
s << " sudo launchctl load #{plist_link}"
- else
- if Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
- s << "To reload #{f.name} after an upgrade:"
- s << " launchctl unload #{plist_link}"
- s << " launchctl load #{plist_link}"
- else
- s << "To load #{f.name}:"
- s << " launchctl load #{plist_link}"
- end
- end
+ elsif Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
+ s << "To reload #{f.name} after an upgrade:"
+ s << " launchctl unload #{plist_link}"
+ s << " launchctl load #{plist_link}"
+ else
+ s << "To load #{f.name}:"
+ s << " launchctl load #{plist_link}"
end
if f.plist_manual