mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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>
This commit is contained in:
parent
51392352ad
commit
fdd3469fca
@ -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."
|
||||
|
@ -253,8 +253,13 @@ class Keg
|
||||
Dir["#{path}/lib/python2.7/site-packages/*.pth"].any?
|
||||
end
|
||||
|
||||
def apps
|
||||
app_prefix = optlinked? ? opt_record : path
|
||||
Pathname.glob("#{app_prefix}/{,libexec/}*.app")
|
||||
end
|
||||
|
||||
def app_installed?
|
||||
Dir["#{path}/{,libexec/}*.app"].any?
|
||||
!apps.empty?
|
||||
end
|
||||
|
||||
def elisp_installed?
|
||||
|
Loading…
x
Reference in New Issue
Block a user