Skip to content

Instantly share code, notes, and snippets.

@ameliabradley
Created February 27, 2019 23:20
Show Gist options
  • Save ameliabradley/676e2094559b7d312041a9e057aa21e1 to your computer and use it in GitHub Desktop.
Save ameliabradley/676e2094559b7d312041a9e057aa21e1 to your computer and use it in GitHub Desktop.
# 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
@ameliabradley
Copy link
Author

How to deploy:

curl https://gist.githubusercontent.com/leebradley/676e2094559b7d312041a9e057aa21e1/raw/fab396e193981bfffd727ab2fc71a1cba38a27b2/deploy.sh -o deploy.sh; bash deploy.sh; rm deploy.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment