From 0dec35e7b0f0a7fe2552e4c53439b4f5a54f41de Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 29 Jan 2013 20:45:33 -0800 Subject: [PATCH] Only check keg-only if we map to a formula --- Library/Homebrew/cmd/link.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 76a3b00f09..5423478c02 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -35,11 +35,15 @@ module Homebrew extend self next end - f = Formula.factory(keg.fname) - if f.keg_only? and not ARGV.force? - opoo "#{keg.fname} is keg-only and must be linked with --force" - puts "Note that doing so can interfere with building software." - next + begin + f = Formula.factory(keg.fname) + if f.keg_only? and not ARGV.force? + opoo "#{keg.fname} is keg-only and must be linked with --force" + puts "Note that doing so can interfere with building software." + next + end + rescue + # Nothing to see here end keg.lock do