diff options
author | Brandon Mathis <brandon@imathis.com> | 2013-06-15 09:33:58 -0700 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2013-06-15 09:33:58 -0700 |
commit | 82e247320ececdcea0ba10114c2e10d836e652fc (patch) | |
tree | 25a6be1cbdaae900d24139f09cb680739e7ccfa6 | |
parent | 2292fc03d64aca88b4014381fc9742effb69ef91 (diff) | |
parent | f5bb4dd89ea64181910acb8ef0df5ae84644b75d (diff) | |
download | my_new_personal_website-82e247320ececdcea0ba10114c2e10d836e652fc.tar.xz my_new_personal_website-82e247320ececdcea0ba10114c2e10d836e652fc.zip |
Merge pull request #1275 from erizhang/add_https_support
add https protocol supporting during rake setup_github_pages
-rw-r--r-- | Rakefile | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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? |