Skip to content

Commit

Permalink
Use chmod to change perrmissions of files before deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
tekktrik committed Jan 15, 2025
1 parent 74bbefd commit 4324ce0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/rmdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@

# pragma: no cover

import os
import shutil
import sys

target = sys.argv[1]

for root, dirs, files in os.walk(target):
children = dirs.extend(files)
for name in children:
filepath = os.path.join(root, name)
os.chmod(filepath, 0o777)

shutil.rmtree(target)

0 comments on commit 4324ce0

Please sign in to comment.