Skip to content

Commit

Permalink
Update orphaned.py
Browse files Browse the repository at this point in the history
  • Loading branch information
onedr0p authored Oct 10, 2024
1 parent 07b5dce commit 641d3b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qbtools/commands/orphaned.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ def get_size(path):

def delete(item_path):
if app.dry_run:
logger.info(f"Skipping ..{os.path.relpath(item_path, start=completed_dir)} because --dry-run was specified")
logger.info(f"Skipping ...{os.path.relpath(item_path, start=completed_dir)} because --dry-run was specified")
return

try:
item_size = get_size(item_path) # Get the size of the item before deletion

if os.path.isfile(item_path):
os.remove(item_path)
logger.info(f"Deleted file ..{os.path.relpath(item_path, start=completed_dir)}")
logger.info(f"Deleted ...{os.path.relpath(item_path, start=completed_dir)}")
elif os.path.isdir(item_path):
shutil.rmtree(item_path)
logger.info(f"Deleted folder ..{os.path.relpath(item_path, start=completed_dir)}")
logger.info(f"Deleted ...{os.path.relpath(item_path, start=completed_dir)}")
else:
logger.debug(f"{os.path.relpath(item_path, start=completed_dir)} does not exist")
return
Expand Down

0 comments on commit 641d3b5

Please sign in to comment.