Spaces:
Sleeping
Sleeping
Download delete_extra_dirs.sh from openfree/encrypted_dna: direct link, hf CLI and curl.
- Browser
- Download file 895 Bytes
-
https://huggingface.co/spaces/openfree/encrypted_dna/resolve/main/delete_extra_dirs.sh
- Command line
-
hf download hf://spaces/openfree/encrypted_dna/delete_extra_dirs.sh
-
curl -L -o delete_extra_dirs.sh https://huggingface.co/spaces/openfree/encrypted_dna/resolve/main/delete_extra_dirs.sh
895 Bytes
| # Define the base directories (adjust if needed) | |
| BASE_DIR1="$(pwd)/deployment/base_modules" # First base directory | |
| BASE_DIR2="$(pwd)/deployment/smoother_module" # Second base directory | |
| # Function to check directory and delete long numeric named directories | |
| cleanup_directory() { | |
| local DIR="$1" | |
| # Check if the base directory exists | |
| if [ ! -d "$DIR" ]; then | |
| echo "Directory $DIR does not exist." | |
| exit 1 | |
| fi | |
| # Find and delete directories with long numeric names | |
| echo "Searching for directories with long numeric names inside $DIR..." | |
| find "$DIR" -type d -regextype posix-extended -regex '.*/[0-9]{15,}' -exec rm -rf {} + | |
| # Confirm completion | |
| echo "Cleanup complete for $DIR. All directories with long numeric names have been removed." | |
| } | |
| # Call the function for each base directory | |
| cleanup_directory "$BASE_DIR1" | |
| cleanup_directory "$BASE_DIR2" | |