Skip to content

Commit

Permalink
remove files and dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
kvbik committed Feb 9, 2012
1 parent e66ee8b commit a78627e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rvirtualenv/copy.py
@@ -1,6 +1,6 @@

from os.path import join, dirname
from os import makedirs, walk
from os.path import join, dirname, isfile
from os import makedirs, walk, remove
import shutil

import rvirtualenv
Expand All @@ -23,7 +23,11 @@ def remove_ignored(src, dst, ignore=None):
if ignore is not None:
ignored = ignore(base.replace(dst, src), dirs+files)
for i in ignored:
shutil.rmtree(i.replace(src, dst), True)
f = join(base, i)
if not isfile(f):
shutil.rmtree(f, True)
else:
remove(f)

def copytree(src, dst, symlinks=False, ignore=None):
shutil.copytree(src, dst, symlinks)
Expand Down

0 comments on commit a78627e

Please sign in to comment.