File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ Previewing Your Changes Online
5050
5151We have a special script to use to publish your changes using the ` gh-pages `
5252branch of your fork of ev3dev.github.io. If you have SSH setup for your GitHub
53- account, simply run` ./publish <gh-user> ` where * gh-user* is your actual GitHub
54- user name. If you don't have SSH setup, you can use https by running
55- ` ./publish https://github.com/<gh-user>/ev3dev.github.io.git ` instead.
53+ account, simply run` ./publish <gh-user> ` where ` <gh-user> ` is your actual GitHub
54+ user name.
5655This will copy the contents of ` _site ` , fix it up a bit and push it to your
5756fork on GitHub. You can view the results at ` http://<gh-user>.github.io/ev3dev.github.io ` .
Original file line number Diff line number Diff line change 55# This script publishes the ev3dev website to the gh-pages branch of your
66# personal fork. This allows you to share a preview of your changes with others.
77#
8- # Usage: ./publish.rb { <gh-user> | <gh-url> } [ --test '<command>' ] [ --no-fix-links ]
8+ # Usage: ./publish.rb { <gh-user> } [ --ssh ] [ --test '<command>' ] [ --no-fix-links ]
99#
10- # <gh-user> is your github user name. This is short for
11- # "git@github.com:<gh-user>/ev3dev.github.io.git"
10+ # <gh-user> is your github user name.
1211#
13- # <gh-url> is the url for your fork on GitHub. For example, if you don't want
14- # to use ssh, then pass "https://github.com/<gh-user>/ev3dev.github.io.git"
15- # as the argument.
12+ # --ssh will use SSH instead of HTTPS when connecting to GitHub.
1613#
1714# --test '<command>' will run <command> in a shell and return the result. The
1815# working directory will be a temporary directory containing the fixed up files.
3633 system "git init"
3734
3835 unless ARGV . include? "--test"
39- git_url = ARGV [ 0 ]
40- if not git_url . include? "/"
41- git_url = "git@github.com:#{ ARGV [ 0 ] } /ev3dev.github.io.git"
36+ gh_user = ARGV [ 0 ]
37+ if ARGV . include? ( "--ssh" )
38+ git_url = "git@github.com:#{ gh_user } /ev3dev.github.io.git"
39+ else
40+ git_url = "https://github.com/#{ gh_user } /ev3dev.github.io.git"
4241 end
4342 system "git remote add origin #{ git_url } "
4443
You can’t perform that action at this time.
0 commit comments