Fix some broken spec expectations and move/rename a method

This commit is contained in:
Nicolas McCurdy
2014-01-07 20:03:09 -05:00
parent c667cefd4c
commit 7e659f11fe
2 changed files with 13 additions and 13 deletions

View File

@@ -42,12 +42,12 @@ class Homesick < Thor
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: destination
git_clone uri
else
fail "Unknown URI format: #{uri}"
end
rc(destination)
setup_castle(destination)
end
end
@@ -433,4 +433,15 @@ class Homesick < Thor
ln_s absolute_path, home_path
end
end
def setup_castle(path)
if path.join('.gitmodules').exist?
inside path do
git_submodule_init
git_submodule_update
end
end
rc(path)
end
end

View File

@@ -16,17 +16,6 @@ class Homesick
say_status 'git clone', "#{repo} to #{destination.expand_path}", :green unless options[:quiet]
system "git clone -q --config push.default=upstream --recursive #{repo} #{destination}" unless options[:pretend]
end
git_setup_submodules destination
end
def git_setup_submodules(path)
if path.join('.gitmodules').exist?
inside path do
git_submodule_init
git_submodule_update
end
end
end
def git_init(path = '.')