setup_github_pages: allow for clones missing .git extension

Conflicts:
	Rakefile
This commit is contained in:
Vaz Allen 2012-10-03 11:50:08 -07:00 committed by Brandon Mathis
parent ef9119089d
commit ec07a5d7f8

View File

@ -390,7 +390,7 @@ task :setup_github_pages, :repo do |t, args|
project = (branch == 'gh-pages') ? repo_url.match(/\/(.+)(\.git)/)[1] : '' project = (branch == 'gh-pages') ? repo_url.match(/\/(.+)(\.git)/)[1] : ''
url = "http://#{user}.github.com" url = "http://#{user}.github.com"
url += "/#{project}" unless project == '' url += "/#{project}" unless project == ''
unless `git remote -v`.match(/origin.+?octopress.git/).nil? unless `git remote -v`.match(/origin.+?octopress(\.git/).nil?
# If octopress is still the origin remote (from cloning) rename it to octopress # If octopress is still the origin remote (from cloning) rename it to octopress
system "git remote rename origin octopress" system "git remote rename origin octopress"
if branch == 'master' if branch == 'master'