added delete confirmation

This commit is contained in:
phixxy 2026-03-05 00:49:05 -08:00
parent 13bd3e4703
commit 94e42cfe65

View file

@ -14,11 +14,14 @@ def delete_all(d):
if not os.path.exists(d):
print("Nothing to delete")
else:
for file in os.listdir(d):
f = os.path.join(d,file)
os.remove(f)
print(f"removing: {f}")
print("Done")
list_all(d)
x = input("Delete the above files? y/N ")
if x.lower() == 'y':
for file in os.listdir(d):
f = os.path.join(d,file)
os.remove(f)
print(f"removing: {f}")
print("Done")
def list_all(d):
if not os.path.exists(d):