From 7e659f11fe7edb4ae63c8bef7feed64ba56e5dfa Mon Sep 17 00:00:00 2001 From: Nicolas McCurdy Date: Tue, 7 Jan 2014 20:03:09 -0500 Subject: [PATCH] Fix some broken spec expectations and move/rename a method --- lib/homesick.rb | 15 +++++++++++++-- lib/homesick/actions.rb | 11 ----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index c707dfc..dde5198 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -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 diff --git a/lib/homesick/actions.rb b/lib/homesick/actions.rb index c9d73e9..096aad4 100644 --- a/lib/homesick/actions.rb +++ b/lib/homesick/actions.rb @@ -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 = '.')