]> granicus.if.org Git - jq/commitdiff
Script to update gh-pages from master
authorDavid Tolnay <dtolnay@gmail.com>
Sat, 8 Aug 2015 03:20:30 +0000 (20:20 -0700)
committerDavid Tolnay <dtolnay@gmail.com>
Sat, 8 Aug 2015 07:29:22 +0000 (00:29 -0700)
scripts/update-website [new file with mode: 0755]

diff --git a/scripts/update-website b/scripts/update-website
new file mode 100755 (executable)
index 0000000..4578a05
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# This script builds the website from the docs directory of
+# the current branch and copies it over to the gh-pages
+# branch.
+
+set -eu
+set -o xtrace
+
+# build website
+scriptdir=`dirname "$0"`
+cd "$scriptdir"/../docs
+rm -rf output
+rake build
+cd ..
+
+# copy to /tmp
+tmpdir=$(mktemp -d -t jq.website.XXXXXXXXXX)
+cp -r docs/output/* "$tmpdir"
+
+# copy to gh-pages
+git checkout gh-pages
+cp -r "$tmpdir"/* .
+
+# clean up
+rm -rf "$tmpdir"
+echo SUCCESS