File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,15 @@ set -o pipefail
55
66URL=$1
77BRANCH=$2
8+ BRANCH_FROM=$3
89SRC=$( pwd)
910TEMP=$( mktemp -d -t jgd-XXX)
1011trap " rm -rf ${TEMP} " EXIT
1112CLONE=${TEMP} /clone
1213COPY=${TEMP} /copy
1314
1415echo -e " Cloning Github repository:"
15- git clone " ${URL} " " ${CLONE} "
16+ git clone -b " ${BRANCH_FROM} " " ${URL} " " ${CLONE} "
1617cp -R ${CLONE} ${COPY}
1718
1819cd " ${CLONE} "
Original file line number Diff line number Diff line change @@ -10,10 +10,13 @@ Usage: jgd [options]
1010 EOS
1111 opt :url , 'Github URL' , type : String , default : ''
1212 opt :branch , 'Destination branch' , type : String , default : 'gh-pages'
13+ opt :branch_from , 'Source branch' , type : String , default : 'master'
1314end
1415
1516branch = opts [ :branch ]
17+ branch_from = opts [ :branch_from ]
1618fail 'branch can\'t be empty' if branch . empty?
19+ fail 'branch-from can\'t be empty' if branch_from . empty?
1720url = opts [ :url ]
1821url = `git config --get remote.origin.url` . strip if url . empty?
1922
@@ -22,4 +25,4 @@ root = spec.gem_dir
2225script = File . join ( root , 'bash/deploy.sh' )
2326
2427fail 'deployment failed, see log above' \
25- unless system ( "#{ script } #{ url } #{ branch } " )
28+ unless system ( "#{ script } #{ url } #{ branch } #{ branch_from } " )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ git config user.name "Test"
1414git commit -am ' initial commit'
1515cd " ${CWD} "
1616
17- ./bash/deploy.sh " ${TMP} " gh-pages
17+ ./bash/deploy.sh " ${TMP} " gh-pages master
1818
1919cd " ${TMP} "
2020git checkout gh-pages
You can’t perform that action at this time.
0 commit comments