From de0b14bbd665c6d0bfb6e97fb187fe69a6d30b72 Mon Sep 17 00:00:00 2001 From: Jacob Atzen Date: Sat, 13 Mar 2010 20:04:03 +0100 Subject: [PATCH] Don't try to recognize git uri's There's a bunch of different way to specify git uri's. Instead of trying to recognize uri's let's just accept that the user knows, what he's doing. --- lib/homesick.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index 2a8b65a..3048598 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -24,17 +24,16 @@ class Homesick < Thor self.shell = Homesick::Shell.new end - GIT_URI_PATTERN = /^git:\/\// GITHUB_NAME_REPO_PATTERN = /([A-Za-z_-]+)\/([A-Za-z_-]+)/ desc "clone URI", "Clone +uri+ as a castle for homesick" def clone(uri) empty_directory repos_dir, :verbose => false inside repos_dir do - if uri =~ GIT_URI_PATTERN - git_clone uri - elsif uri =~ GITHUB_NAME_REPO_PATTERN + if uri =~ GITHUB_NAME_REPO_PATTERN git_clone "git://github.com/#{$1}/#{$2}.git", "#{$1}_#{$2}" + else + git_clone uri end end end