Skip to content

Commit a2657b4

Browse files
committed
Merge branch '__rultor'
2 parents 592e930 + e0bf376 commit a2657b4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

bash/deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ set -o pipefail
55

66
URL=$1
77
BRANCH=$2
8+
BRANCH_FROM=$3
89
SRC=$(pwd)
910
TEMP=$(mktemp -d -t jgd-XXX)
1011
trap "rm -rf ${TEMP}" EXIT
1112
CLONE=${TEMP}/clone
1213
COPY=${TEMP}/copy
1314

1415
echo -e "Cloning Github repository:"
15-
git clone "${URL}" "${CLONE}"
16+
git clone -b "${BRANCH_FROM}" "${URL}" "${CLONE}"
1617
cp -R ${CLONE} ${COPY}
1718

1819
cd "${CLONE}"

bin/jgd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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'
1314
end
1415

1516
branch = opts[:branch]
17+
branch_from = opts[:branch_from]
1618
fail 'branch can\'t be empty' if branch.empty?
19+
fail 'branch-from can\'t be empty' if branch_from.empty?
1720
url = opts[:url]
1821
url = `git config --get remote.origin.url`.strip if url.empty?
1922

@@ -22,4 +25,4 @@ root = spec.gem_dir
2225
script = File.join(root, 'bash/deploy.sh')
2326

2427
fail 'deployment failed, see log above' \
25-
unless system("#{script} #{url} #{branch}")
28+
unless system("#{script} #{url} #{branch} #{branch_from}")

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ git config user.name "Test"
1414
git commit -am 'initial commit'
1515
cd "${CWD}"
1616

17-
./bash/deploy.sh "${TMP}" gh-pages
17+
./bash/deploy.sh "${TMP}" gh-pages master
1818

1919
cd "${TMP}"
2020
git checkout gh-pages

0 commit comments

Comments
 (0)