Last active
August 6, 2016 20:26
-
-
Save bonndan/42cecfc5c5f4936321ce to your computer and use it in GitHub Desktop.
gh-pages post commit hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
if [ "gh-pages" == "$branch" ]; then | |
exit | |
fi | |
echo Updating gh-pages for branch $branch | |
git checkout gh-pages | |
git checkout $branch -- dist | |
mkdir -p $branch | |
git rm --ignore-unmatch -rf $branch | |
mv -f dist/* $branch | |
git rm -rf --ignore-unmatch dist | |
git add $branch | |
git describe --always | git commit -m - | |
git checkout $branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment