Created
September 2, 2014 09:18
-
-
Save M1ke/ddd742feb41e281136c1 to your computer and use it in GitHub Desktop.
After accidentally pushing a development branch out to production (fortunately no problems, just unexpected new features for users) I decided to proactively prevent it happening again with a simple bit of bash and git.
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/bash | |
# We only run the deployment if we're already on master; we could do this directly in gulp but it allows for other commands to be added | |
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ]; then | |
gulp deploy | |
else | |
echo "Must be on master" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment