From 27baa4cf3d3baefb35a93c736c65a8d9e7026988 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Fri, 17 Apr 2015 02:08:55 +0100 Subject: 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 #38728. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/linkapps.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/linkapps.rb b/Library/Homebrew/cmd/linkapps.rb index 7e8430c75..b21cbcd1f 100644 --- a/Library/Homebrew/cmd/linkapps.rb +++ b/Library/Homebrew/cmd/linkapps.rb @@ -25,7 +25,7 @@ module Homebrew kegs.each do |keg| keg = keg.opt_record if keg.optlinked? 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) target = "#{target_dir}/#{app_name}" @@ -33,10 +33,9 @@ module Homebrew onoe "#{target} already exists, skipping." next end + system "ln", "-sf", app, target_dir end end - - puts "Finished linking. Find the links under #{target_dir}." end end -- cgit v1.2.3