Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@janlelis
Created February 8, 2016 22:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janlelis/b9a4d3cb273ac07114c5 to your computer and use it in GitHub Desktop.
Save janlelis/b9a4d3cb273ac07114c5 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ -n "$(git status --porcelain)" ]; then
echo "\033[31;1mWorking directory needs to be clean\033[0m";
exit 1
else
git checkout production &&
git rebase develop &&
npm run build &&
git add -f dist &&
git commit -m "Update to $(git rev-parse develop)" &&
git push -f origin production &&
git checkout develop &&
echo "\033[32;1mSuccessfully updated and pushed production branch\033[0m"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment