From 78d7e305d7e7b8ecece29a801536b61b524ec819 Mon Sep 17 00:00:00 2001 From: sanj <67624670+iodrift@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:06:44 -0700 Subject: [PATCH] added delpycache for deleting all __pycache__ folders in current folder and its subfolders --- .DS_Store | Bin 0 -> 6148 bytes delpycache | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .DS_Store create mode 100755 delpycache diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4e95e0ae875a336ce09224eb64cb6eda6a12d29a GIT binary patch literal 6148 zcmeHKJ5Iwu5SVoofHTgP)lHha~Q(02TOC z3Z$x8HVeE`^w!bKX|K)j75vLkYvow16$7mmW23G3x>uL=8u=2~IT{^tqXYRPpt{hg Iz;7t<2^}maJ^%m! literal 0 HcmV?d00001 diff --git a/delpycache b/delpycache new file mode 100755 index 0000000..5ec9a3a --- /dev/null +++ b/delpycache @@ -0,0 +1,27 @@ +#!/bin/bash + +# Default directories to search +directories=("~/sync" "~/workshop") + +# Check if a command line argument is provided +if [ $# -gt 0 ]; then + if [ "$1" == "." ]; then + # Use the current directory + directories=(".") + else + # Use the provided directory + directories=("$1") + fi +fi + +# Iterate through each directory +for dir in "${directories[@]}"; do + # Expand tilde to home directory + expanded_dir=$(eval echo "$dir") + + # Find and delete __pycache__ directories + find "$expanded_dir" -type d -name "__pycache__" -exec rm -rf {} + +done + +echo "Deletion of __pycache__ folders completed." +