Fix some broken spec expectations and move/rename a method
This commit is contained in:
@@ -42,12 +42,12 @@ class Homesick < Thor
|
|||||||
git_clone "https://github.com/#{Regexp.last_match[1]}.git", destination: destination
|
git_clone "https://github.com/#{Regexp.last_match[1]}.git", destination: destination
|
||||||
elsif uri =~ /%r([^%r]*?)(\.git)?\Z/ || uri =~ /[^:]+:([^:]+)(\.git)?\Z/
|
elsif uri =~ /%r([^%r]*?)(\.git)?\Z/ || uri =~ /[^:]+:([^:]+)(\.git)?\Z/
|
||||||
destination = Pathname.new(Regexp.last_match[1])
|
destination = Pathname.new(Regexp.last_match[1])
|
||||||
git_clone uri, destination: destination
|
git_clone uri
|
||||||
else
|
else
|
||||||
fail "Unknown URI format: #{uri}"
|
fail "Unknown URI format: #{uri}"
|
||||||
end
|
end
|
||||||
|
|
||||||
rc(destination)
|
setup_castle(destination)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -433,4 +433,15 @@ class Homesick < Thor
|
|||||||
ln_s absolute_path, home_path
|
ln_s absolute_path, home_path
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|||||||
@@ -16,17 +16,6 @@ class Homesick
|
|||||||
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]
|
||||||
system "git clone -q --config push.default=upstream --recursive #{repo} #{destination}" unless options[:pretend]
|
system "git clone -q --config push.default=upstream --recursive #{repo} #{destination}" unless options[:pretend]
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def git_init(path = '.')
|
def git_init(path = '.')
|
||||||
|
|||||||
Reference in New Issue
Block a user