diff --git a/lib/homesick.rb b/lib/homesick.rb index 74a9e88..275f742 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -33,7 +33,7 @@ class Homesick < Thor ln_s uri, destination elsif uri =~ GITHUB_NAME_REPO_PATTERN - destination = Pathname.new($1) + destination = Pathname.new(uri).basename git_clone "https://github.com/#{$1}.git", :destination => destination elsif uri =~ /%r([^%r]*?)(\.git)?\Z/ destination = Pathname.new($1) diff --git a/spec/homesick_spec.rb b/spec/homesick_spec.rb index 1770c64..1d60226 100644 --- a/spec/homesick_spec.rb +++ b/spec/homesick_spec.rb @@ -94,7 +94,7 @@ describe 'homesick' do end it 'should clone a github repo' do - homesick.should_receive(:git_clone).with('https://github.com/wfarr/dotfiles.git', :destination => Pathname.new('wfarr/dotfiles')) + homesick.should_receive(:git_clone).with('https://github.com/wfarr/dotfiles.git', :destination => Pathname.new('dotfiles')) homesick.clone 'wfarr/dotfiles' end