aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorXu Cheng2014-07-03 19:28:09 +0800
committerMike McQuaid2014-08-31 19:18:11 +0100
commit0ed263faf3735d0958d9a447c561bf3db51c42e4 (patch)
treeecb50f0281b13c9b19c72572ffaaaf9cf15a0620 /Library/Homebrew
parentdbcbf2325e9c2bc0114338ca6c291a1eba5dda65 (diff)
downloadhomebrew-0ed263faf3735d0958d9a447c561bf3db51c42e4.tar.bz2
plist_caveats: remove `launchctl list` as it requires sudo for root services
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/caveats.rb37
1 files changed, 17 insertions, 20 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index cd03952ee..1973dff42 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -104,33 +104,30 @@ class Caveats
else
s << " launchctl load #{plist_link}"
end
- if f.plist_manual
- s << "Or, if you don't want/need launchctl, you can just run:"
- s << " #{f.plist_manual}"
- end
- elsif Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
- s << "To reload #{f.name} after an upgrade:"
+ else
if 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
- s << " launchctl unload #{plist_link}"
- s << " launchctl load #{plist_link}"
- end
- else
- s << "To load #{f.name}:"
- if f.plist_startup
- s << " sudo launchctl load #{plist_link}"
- else
- s << " launchctl load #{plist_link}"
- end
- if f.plist_manual
- s << "Or, if you don't want/need launchctl, you can just run:"
- s << " #{f.plist_manual}"
+ 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
end
- s << '' << "WARNING: launchctl will fail when run under tmux." if ENV['TMUX']
+
+ if f.plist_manual
+ s << "Or, if you don't want/need launchctl, you can just run:"
+ s << " #{f.plist_manual}"
+ end
+
+ s << "" << "WARNING: launchctl will fail when run under tmux." if ENV['TMUX']
end
s.join("\n") unless s.empty?
end