aboutsummaryrefslogtreecommitdiffstats
path: root/tool/update-gh-pages
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-08-18 13:55:08 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-08-18 16:18:03 +0900
commit0fa04d370c34a57ab9533d9ea88123b00f20943f (patch)
tree555c3d68233f181cdbb9675e3453e664518327ec /tool/update-gh-pages
parent01cf28145f7110b129a0faf699200a43adc08160 (diff)
downloadruby-openssl-0fa04d370c34a57ab9533d9ea88123b00f20943f.tar.gz
Add tool/update-gh-pages
A shell script to generate RDoc HTML and update gh-pages branch.
Diffstat (limited to 'tool/update-gh-pages')
-rwxr-xr-xtool/update-gh-pages22
1 files changed, 22 insertions, 0 deletions
diff --git a/tool/update-gh-pages b/tool/update-gh-pages
new file mode 100755
index 00000000..8eb546a9
--- /dev/null
+++ b/tool/update-gh-pages
@@ -0,0 +1,22 @@
+#!/bin/sh
+set -e
+
+# Generates RDoc HTML and update gh-pages branch.
+
+HEAD_DESCRIPTION=$(git describe --dirty --always --abbrev=12)
+
+[ -d html ] &&
+ rm -r html
+rake rdoc
+
+[ ! -d tmp/gh-pages ] &&
+ git worktree add tmp/gh-pages gh-pages
+(
+ cd tmp/gh-pages
+
+ git rm -r .
+ cp -r ../../html/* .
+ rm created.rid js/*.gz # to avoid unnecessary change :x
+ git add .
+ git commit -m "Sync with $HEAD_DESCRIPTION"
+)