svnborg.sh

I've been doing a bit of Ruby on Rails development lately at work. I use Subversion on our development server to manage the code which I check in at certain milestones throughout the day.

One of the great things with Rails is that it'll generate (scaffold) a fair bit of your CRUD code, if you want. This makes the transition from having a database table defined through to having an interface that lets you interact with that table very smooth. It also generates a bunch of files throughout the tree.

When you run svn status these new files are shown with a question mark at the beginning of the line. This snippet of code, which lives in /home/mlambie/bin/svnborg.sh, adds any such file to the repository. Simple but useful.

#!/bin/bash
echo "Borging commenced."
svn status | grep "^?" | cut -f7 -d" " | xargs svn add
echo "Borging completed."

Leave a Reply