Skip to content

Instantly share code, notes, and snippets.

@tsauerwein
Last active August 29, 2015 14:28
Show Gist options
  • Save tsauerwein/2c58607be011a4717ceb to your computer and use it in GitHub Desktop.
Save tsauerwein/2c58607be011a4717ceb to your computer and use it in GitHub Desktop.
OpenLayers 3: Update gh-pages
#!/bin/bash
# run from inside the ol3 directory with e.g.:
# ./../update-gh-pages.sh draw-and-modify
#
# http://tsauerwein.github.io/ol3/draw-and-modify/examples/
if [[ -z $1 ]]; then
echo "Usage error."
exit 1
fi
branch=$1
repo="build/ol3-gh-pages"
if [[ ! -d ${repo} ]]; then
git clone [email protected]:tsauerwein/ol3.git ${repo}
fi
make host-examples
cd ${repo}
git fetch origin
git checkout gh-pages
git merge --ff-only origin/gh-pages
git rm --ignore-unmatch -rqf ${branch}
cp -r ../hosted/${branch} ./
git add -A .
git commit -m 'Update gh-pages'
git push origin gh-pages
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment