Sunday, July 08, 2007

cleancvs.py

#cleancvs.py
#
#Remove directories or files with the name CVS
#
#Doesn't check whether the file it is deleting is a cvs directory. 
#And expects unix path seperators.
#
#usage:
#python cleancvs.py [path to clean]


import sys
import shutil

dir = sys.argv[1]

for basePath, files, directories in os.walk(dir):
    if basePath.endswith("/CVS"):
        shutil.rmtree(basePath)