aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/linkapps.rb
diff options
context:
space:
mode:
authorMartin Afanasjew2015-10-20 07:05:21 +0200
committerXu Cheng2015-10-20 18:25:28 +0800
commitfdd3469fca62eab96ed0c111451ba0e0a2efbbcc (patch)
treed5fdd99a3b60d8e6ac800632c5a98a4a59264d54 /Library/Homebrew/cmd/linkapps.rb
parent51392352adc73b10c227b71153e66ba620cfb2fd (diff)
downloadbrew-fdd3469fca62eab96ed0c111451ba0e0a2efbbcc.tar.bz2
linkapps: stop linking .app bundles from 'bin/'
`Keg#app_installed?` only checks the formula prefix and `libexec/` for .app bundles to determine if a formula provides any. This is used by `Caveats#app_caveats` to generate an appropriate message. The same list should be used by `brew linkapps` for consistency. Reduce likelihood of future inconsistencies by creating `Keg#apps` and using it in place of the duplicate code. Closes Homebrew/homebrew#45173. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/cmd/linkapps.rb')
-rw-r--r--Library/Homebrew/cmd/linkapps.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/linkapps.rb b/Library/Homebrew/cmd/linkapps.rb
index 9a58bd37a..dba9beaa5 100644
--- a/Library/Homebrew/cmd/linkapps.rb
+++ b/Library/Homebrew/cmd/linkapps.rb
@@ -23,11 +23,9 @@ module Homebrew
end
kegs.each do |keg|
- keg = keg.opt_record if keg.optlinked?
- Dir["#{keg}/*.app", "#{keg}/bin/*.app", "#{keg}/libexec/*.app"].each do |app|
+ keg.apps.each do |app|
puts "Linking #{app} to #{target_dir}."
- app_name = File.basename(app)
- target = "#{target_dir}/#{app_name}"
+ target = "#{target_dir}/#{app.basename}"
if File.exist?(target) && !File.symlink?(target)
onoe "#{target} already exists, skipping."