linkapps: output nothing if no apps exist
The standard message can be somewhat confusing (#38695) in that it outputs “finished linking” language regardless of whether an app is actually present/linked or not. This solution just stops it saying anything if there’s no app in the directory. It needs a little tidying in the output here, but it’s a discussion point. Closes Homebrew/homebrew#38728. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
adedbb86f1
commit
703de5556f
@ -25,7 +25,7 @@ module Homebrew
|
|||||||
kegs.each do |keg|
|
kegs.each do |keg|
|
||||||
keg = keg.opt_record if keg.optlinked?
|
keg = keg.opt_record if keg.optlinked?
|
||||||
Dir["#{keg}/*.app", "#{keg}/bin/*.app", "#{keg}/libexec/*.app"].each do |app|
|
Dir["#{keg}/*.app", "#{keg}/bin/*.app", "#{keg}/libexec/*.app"].each do |app|
|
||||||
puts "Linking #{app}"
|
puts "Linking #{app} to #{target_dir}."
|
||||||
app_name = File.basename(app)
|
app_name = File.basename(app)
|
||||||
target = "#{target_dir}/#{app_name}"
|
target = "#{target_dir}/#{app_name}"
|
||||||
|
|
||||||
@ -33,10 +33,9 @@ module Homebrew
|
|||||||
onoe "#{target} already exists, skipping."
|
onoe "#{target} already exists, skipping."
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
system "ln", "-sf", app, target_dir
|
system "ln", "-sf", app, target_dir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Finished linking. Find the links under #{target_dir}."
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user