class Registry::Git

def checkout

def checkout
  if project_in_git?
    system "git submodule add #{url} vendor/extensions/#{name}"
    cd(File.join('vendor', 'extensions', name)) do
      system "git submodule init && git submodule update"
    end
  else
    super
    cd(path) do
      system "git submodule init && git submodule update"
    end
  end
end

def checkout_command

def checkout_command
  "git clone #{url} #{name}"
end

def copy_to_vendor_extensions

def copy_to_vendor_extensions
  super unless project_in_git?
end

def project_in_git?

def project_in_git?
  @in_git ||= File.directory?(".git")
end