This commit is contained in:
Florian Bruhin 2014-05-16 07:49:04 +02:00
parent 480e222d6d
commit 8f58d22ad7
2 changed files with 3 additions and 3 deletions

View File

@ -36,11 +36,11 @@ def remove(path):
"""Remove either a file or directory unless --dry-run is given.""" """Remove either a file or directory unless --dry-run is given."""
if os.path.isdir(path): if os.path.isdir(path):
print("rm -r '{}'".format(path)) print("rm -r '{}'".format(path))
if not '--dry-run' in sys.argv: if '--dry-run' not in sys.argv:
shutil.rmtree(path) shutil.rmtree(path)
else: else:
print("rm '{}'".format(path)) print("rm '{}'".format(path))
if not '--dry-run' in sys.argv: if '--dry-run' not in sys.argv:
os.remove(path) os.remove(path)