Remove Empty Dirctories from Subversion

A simple script to remove empty directories in a checked out subversion repository:

#!/usr/bin/bash

find . -depth -type d -name .svn | while read d; do
d=$(dirname "$d")
echo >&2 ">>>> $d <<<<"
if [ 1 -eq $(ls -A "$d" | wc -l) ]; then
echo >&2 "Removing..."
svn remove --force "$d"
fi
done
svn status
Posted in Subversion Tagged with: ,