Pass destination when cloning url.

This commit is contained in:
Chris Salzberg
2014-09-24 00:29:06 +09:00
committed by Chris Salzberg
parent e06a5d6300
commit 9ad171ab78
2 changed files with 12 additions and 7 deletions

View File

@@ -50,8 +50,8 @@ module Homesick
git_clone "https://github.com/#{Regexp.last_match[1]}.git",
destination: destination
elsif uri =~ /%r([^%r]*?)(\.git)?\Z/ || uri =~ /[^:]+:([^:]+)(\.git)?\Z/
destination = Pathname.new(Regexp.last_match[1])
git_clone uri
destination = Pathname.new(Regexp.last_match[1].gsub(/\.git$/,'')).basename
git_clone uri, destination: destination
else
fail "Unknown URI format: #{uri}"
end