diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index bdcc8369ef..ee083eb00c 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -29,6 +29,22 @@ module Homebrew extend self tapd.find_formula{ |file| files << tapd.basename.join(file) } tapped = link_tap_formula(files) puts "Tapped #{tapped} formula" + + # Figure out if this repo is private + # curl will throw an exception if the repo is private (Github returns a 404) + begin + curl('-Ifso', '/dev/null', "https://api.github.com/repos/#{repouser}/homebrew-#{repo}") + rescue + puts + puts "It looks like you tapped a private repository" + puts "In order to not input your credentials every time" + puts "you can use git HTTP credential caching or issue the" + puts "following command:" + puts + puts " cd #{tapd}" + puts " git remote set-url origin git@github.com:#{repouser}/homebrew-#{repo}.git" + puts + end end def link_tap_formula formulae