aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorStafford Brunk2012-05-14 16:18:24 -0600
committerMax Howell2012-08-07 14:24:09 -0400
commitcbee0bd2ee617531103b4f179231824aee9838a3 (patch)
tree0677b68472485abc9807348fb208fa719df7b5c8 /Library
parent8c8701f26893f0b0cf9d54c4a6e56657af2d25e8 (diff)
downloadbrew-cbee0bd2ee617531103b4f179231824aee9838a3.tar.bz2
Print an appropriate message if the tapped repository appears to be private
Closes Homebrew/homebrew#12247. Closes Homebrew/homebrew#12244. Signed-off-by: Max Howell <mxcl@me.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/tap.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index bdcc8369e..ee083eb00 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