Self-deleting script accident

December 16, 2006 on 8:35 pm | In Tools n Stuff |

I was working on a build which kept generating loads of files but not cleaning them afterwards. This was causing tests to fail because of stuff hanging around between builds.
So, I wrote a script which deletes files that are local and not in the Subversion repository.

#!/bin/bash

echo Deleting all local files not in Subversion repository:
echo
svn st | grep ? | awk '{ print "deleting... " $2; }'
echo
svn st | grep ? | awk '{print $2; }' | xargs rm -rf
echo Remaining differences to repository:
echo
svn st

Only problem was, because the script was not added to Subversion - it deleted itself.

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Powered by Cheese.     RSS Entries Feed.     RSS Comments Feed     ^Top^