Last active
February 23, 2016 18:11
-
-
Save westonruter/279b4b408f4791be647a 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
function svn { | |
if [ "$1" == 'commit' ] || [ "$1" == 'ci' ]; then | |
repo_url=$( command svn info | grep -E '^URL:' | cut -c6- ) | |
echo "Repo URL: $repo_url" | |
echo | |
echo "Staged changes for commit:" | |
command svn status -q | |
echo -n "Lines: " | |
command svn diff | wc -l | |
echo -n "Sanity check countdown... 5" | |
for i in $( seq 4 0 ); do | |
sleep 1 | |
echo -ne "\b$i" | |
done | |
echo | |
read -p "Are you sure you want to commit? [y/n] " -n 1 -r | |
if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
echo | |
echo "Aborting!" | |
return 1 | |
fi | |
echo | |
fi | |
command svn "$@" | |
} | |
export -f svn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment