Created
January 29, 2012 22:28
-
-
Save joshtronic/1701049 to your computer and use it in GitHub Desktop.
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 | |
# Assists in adding files currently not in a Subversion repository by | |
# automatically prompting you as to whether or not you want to add each | |
# file not currently in the repository | |
# | |
# @author Josh Sherman | |
# @link http://joshtronic.com | |
if [ -z "$1" ]; then | |
echo "Usage: svn-add.sh /path/to/svn/repository" | |
exit | |
else | |
svn_status=`svn status $1` | |
fi | |
add_file=false | |
for i in $svn_status; do | |
if [ $add_file == true ]; then | |
echo -n "Add $i? [Y/n]: " | |
read confirm | |
if [ -z $confirm ] || [ $confirm == "Y" ] || [ $confirm == "y" ]; then | |
svn add $i &> /dev/null | |
echo "Added $i" | |
fi | |
fi | |
if [ $i == "?" ]; then | |
add_file=true | |
else | |
add_file=false | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment