Created
February 27, 2019 23:20
-
-
Save ameliabradley/676e2094559b7d312041a9e057aa21e1 to your computer and use it in GitHub Desktop.
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
# Useful helper script to ensure you're always double-checking your commands | |
cat <<EndOfMessage >> ~/.git-sure.sh | |
#!/bin/bash | |
read -r -p "Are you sure? [y/n] " response; | |
if [[ "$response" =~ ^(yes|y)$ ]]; then git $@; fi; | |
EndOfMessage | |
chmod +x ~/.git-sure.sh | |
if [ -f ~/.zshrc ]; then | |
cat <<EndOfMessage >> ~/.zshrc | |
alias git="~/.git-sure.sh" | |
EndOfMessage | |
source ~/.zshrc | |
else | |
cat <<EndOfMessage >> ~/.bashrc | |
alias git="~/.git-sure.sh" | |
EndOfMessage | |
source ~/.bashrc | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to deploy: