Skip to content

Commit

Permalink
add https protocol supporting during rake setup_github_pages
Browse files Browse the repository at this point in the history
  • Loading branch information
erizhang committed May 31, 2013
1 parent e83dfcc commit f5bb4dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Rakefile
Expand Up @@ -305,9 +305,15 @@ task :setup_github_pages, :repo do |t, args|
else
puts "Enter the read/write url for your repository"
puts "(For example, 'git@github.com:your_username/your_username.github.io)"
puts " or 'https://github.com/your_username/your_username.github.io')"
repo_url = get_stdin("Repository url: ")
end
user = repo_url.match(/:([^\/]+)/)[1]
protocol = (repo_url.match(/(^git)@/).nil?) ? 'https' : 'git'
if protocol == 'git'
user = repo_url.match(/:([^\/]+)/)[1]
else
user = repo_url.match(/github\.com\/([^\/]+)/)[1]
end
branch = (repo_url.match(/\/[\w-]+\.github\.(?:io|com)/).nil?) ? 'gh-pages' : 'master'
project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : ''
unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil?
Expand Down

0 comments on commit f5bb4dd

Please sign in to comment.