Created
October 31, 2014 13:24
-
-
Save dotcore/cf5c54115dcccd82e50f to your computer and use it in GitHub Desktop.
appsuite post-checkout 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_SWITCH=$3 | |
RESET=n | |
if [ $BRANCH_SWITCH == "1" ]; then | |
exec < /dev/tty | |
while true; do | |
read -p "Reset Appsuite UI? (y/n) " yn | |
if [ "$yn" = "" ]; then | |
yn='y' | |
fi | |
case $yn in | |
[Yy] ) RESET=y; break;; | |
[Nn] ) RESET=n; break;; | |
* ) echo "Please answer y or n for yes or no.";; | |
esac | |
done | |
if [ "$RESET" = "y" ]; then | |
cd ./$(git rev-parse --show-cdup) | |
git submodule update | |
cd ui/ | |
rm -rf node_modules bower_components | |
npm install -g bower | |
npm install | |
bower install | |
grunt clean default | |
echo "Reset complete." | |
else | |
echo "Skipping appsuite reset." | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment