Remove dir by shutil.rmtree, remove file by os.remove

This commit is contained in:
askeing 2016-04-29 23:18:28 +09:00
parent 26be403e3c
commit c4b0e20bc5

View file

@ -316,7 +316,10 @@ class MachCommands(CommandBase):
name = path.join(base, name)
if force:
print("Removing " + name)
if os.path.isdir(name):
shutil.rmtree(name)
else:
os.remove(name)
else:
print("Would remove " + name)
if not removing_anything: