Skip to content

Instantly share code, notes, and snippets.

@dotcore
Created October 31, 2014 13:24
Show Gist options
  • Save dotcore/cf5c54115dcccd82e50f to your computer and use it in GitHub Desktop.
Save dotcore/cf5c54115dcccd82e50f to your computer and use it in GitHub Desktop.
appsuite post-checkout hook
#!/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