lib/spaarti/repo.rb in spaarti-0.0.6 vs lib/spaarti/repo.rb in spaarti-0.1.0
- old
+ new
@@ -37,15 +37,19 @@
def run(cmd, error_msg)
res = system "#{cmd} &>/dev/null"
err(error_msg) unless res
end
+ def url
+ @url ||= @data["#{@options[:url_type]}_url".to_sym]
+ end
+
def clone
return log("#{@data[:full_name]} already cloned") if Dir.exist? @path
- log "Cloning #{@data[:ssh_url]} to #{@path}"
+ log "Cloning #{url} to #{@path}"
run(
- "git clone '#{@data[:ssh_url]}' '#{@path}' &>/dev/null",
- "Failed to clone #{@data[:ssh_url]}"
+ "git clone '#{url}' '#{@path}' &>/dev/null",
+ "Failed to clone #{url}"
)
end
def config
@options[:git_config].each do |k, v|