Last active
November 28, 2016 09:10
-
-
Save xpepermint/c35d273fad9a6f5a47053568c365f8e7 to your computer and use it in GitHub Desktop.
git `.git/hooks/pre-post` to commite bundles into `production` branch
This file contains hidden or 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 branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
if [ "master" != "$branch" ]; then | |
exit; | |
fi | |
git checkout production | |
git reset --hard master | |
npm run build | |
git add ./dist -f | |
git commit -m 'production build' | |
git push origin production -f | |
git checkout master | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment