aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/caveats.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-04-22 09:48:34 +0100
committerMike McQuaid2016-04-22 09:48:34 +0100
commit26118d6225ee6d2bb913527191645db04bc10bca (patch)
treed0d0ba6be11021d2345e4c36d0447537c56666ff /Library/Homebrew/caveats.rb
parentb5c27bb7e5f0e63fd7f4a451d7824b2ba0ac39ef (diff)
downloadbrew-26118d6225ee6d2bb913527191645db04bc10bca.tar.bz2
caveats: recommend brew services for plists.
It simplifies the number of commands and it's now an officially supported command again.
Diffstat (limited to 'Library/Homebrew/caveats.rb')
-rw-r--r--Library/Homebrew/caveats.rb38
1 files changed, 12 insertions, 26 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index 63084af03..6e02b168d 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -162,7 +162,6 @@ class Caveats
else
File.basename Dir["#{keg}/*.plist"].first
end
- plist_link = "#{destination}/#{plist_filename}"
plist_domain = f.plist_path.basename(".plist")
destination_path = Pathname.new File.expand_path destination
plist_path = destination_path/plist_filename
@@ -173,44 +172,31 @@ class Caveats
# https://github.com/Homebrew/homebrew/issues/33815
if !plist_path.file? || !plist_path.symlink?
if f.plist_startup
- s << "To have launchd start #{f.full_name} at startup:"
- s << " sudo mkdir -p #{destination}" unless destination_path.directory?
- s << " sudo cp -fv #{f.opt_prefix}/*.plist #{destination}"
- s << " sudo chown root #{plist_link}"
+ s << "To have launchd start #{f.full_name} now and restart at startup:"
+ s << " sudo brew services start #{f.full_name}"
else
- s << "To have launchd start #{f.full_name} at login:"
- s << " mkdir -p #{destination}" unless destination_path.directory?
- s << " ln -sfv #{f.opt_prefix}/*.plist #{destination}"
- end
- s << "Then to load #{f.full_name} now:"
- if f.plist_startup
- s << " sudo launchctl load #{plist_link}"
- else
- s << " launchctl load #{plist_link}"
+ s << "To have launchd start #{f.full_name} now and restart at login:"
+ s << " brew services start #{f.full_name}"
end
# 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.full_name} after an upgrade:"
- s << " sudo launchctl unload #{plist_link}"
- s << " sudo cp -fv #{f.opt_prefix}/*.plist #{destination}"
- s << " sudo chown root #{plist_link}"
- s << " sudo launchctl load #{plist_link}"
+ s << "To restart #{f.full_name} after an upgrade:"
+ s << " sudo brew services restart #{f.full_name}"
elsif Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
- s << "To reload #{f.full_name} after an upgrade:"
- s << " launchctl unload #{plist_link}"
- s << " launchctl load #{plist_link}"
+ s << "To restart #{f.full_name} after an upgrade:"
+ s << " brew services restart #{f.full_name}"
else
- s << "To load #{f.full_name}:"
- s << " launchctl load #{plist_link}"
+ s << "To start #{f.full_name}:"
+ s << " brew services start #{f.full_name}"
end
if f.plist_manual
- s << "Or, if you don't want/need launchctl, you can just run:"
+ s << "Or, if you don't want/need a background service you can just run:"
s << " #{f.plist_manual}"
end
- s << "" << "WARNING: launchctl will fail when run under tmux." if ENV["TMUX"]
+ s << "" << "WARNING: brew services will fail when run under tmux." if ENV["TMUX"]
end
s.join("\n") + "\n" unless s.empty?
end