Clone github repos into username/repo instead of username_repo, for more consistent use with symlink.
This commit is contained in:
@@ -20,7 +20,7 @@ class Homesick < Thor
|
|||||||
def clone(uri)
|
def clone(uri)
|
||||||
inside repos_dir do
|
inside repos_dir do
|
||||||
if uri =~ GITHUB_NAME_REPO_PATTERN
|
if uri =~ GITHUB_NAME_REPO_PATTERN
|
||||||
git_clone "git://github.com/#{$1}/#{$2}.git", :destination => "#{$1}_#{$2}"
|
git_clone "git://github.com/#{$1}/#{$2}.git", :destination => "#{$1}/#{$2}"
|
||||||
else
|
else
|
||||||
git_clone uri
|
git_clone uri
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class Homesick
|
|||||||
end
|
end
|
||||||
|
|
||||||
destination = Pathname.new(destination) unless destination.kind_of?(Pathname)
|
destination = Pathname.new(destination) unless destination.kind_of?(Pathname)
|
||||||
|
FileUtils.mkdir_p destination.dirname
|
||||||
|
|
||||||
if ! destination.directory?
|
if ! destination.directory?
|
||||||
say_status 'git clone', "#{repo} to #{destination.expand_path}", :green unless options[:quiet]
|
say_status 'git clone', "#{repo} to #{destination.expand_path}", :green unless options[:quiet]
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ describe Homesick do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "should clone a github repo" do
|
it "should clone a github repo" do
|
||||||
@homesick.should_receive(:git_clone).with('git://github.com/wfarr/dotfiles.git', :destination => 'wfarr_dotfiles')
|
@homesick.should_receive(:git_clone).with('git://github.com/wfarr/dotfiles.git', :destination => 'wfarr/dotfiles')
|
||||||
|
|
||||||
@homesick.clone "wfarr/dotfiles"
|
@homesick.clone "wfarr/dotfiles"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user