diff --git a/Library/Contributions/cmd/brew-linkapps.rb b/Library/Contributions/cmd/brew-linkapps.rb index 2c11edb81737..571aedc7312b 100755 --- a/Library/Contributions/cmd/brew-linkapps.rb +++ b/Library/Contributions/cmd/brew-linkapps.rb @@ -3,6 +3,12 @@ TARGET_DIR = ARGV.include?("--local") ? File.expand_path("~/Applications") : "/Applications" +unless File.exist? TARGET_DIR + opoo "#{TARGET_DIR} does not exist, stopping." + puts "Run `mkdir #{TARGET_DIR}` first." + exit 1 +end + HOMEBREW_CELLAR.subdirs.each do |rack| kegs = rack.subdirs.map { |d| Keg.new(d) } next if kegs.empty?