pathScripts/delpycache

21 lines
485 B
Bash
Executable file

#!/bin/bash
# Default directories to search
directories=("~/sync" "~/workshop")
# Check if a command line argument is provided
if [ $# -gt 0 ]; then
directories=("$1")
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."