File size: 1,631 Bytes
e250d47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # Sin color

clear

echo "===================================================="
echo -e "        ${RED}Clean and Delete 'input' and 'output' Folders${NC}"
echo "===================================================="
echo

echo -e "${YELLOW}[WARNING]${NC} This script will delete the 'input' and 'output' folders"
echo "           and all their contents in the current directory."
echo "===================================================="
echo

read -p "¿Are you sure you want to proceed? (Y/N) " confirm

confirm_upper=$(echo "$confirm" | tr '[:lower:]' '[:upper:]')

if [ "$confirm_upper" != "Y" ]; then
    echo -e "${RED}[CANCELED]${NC} Operation cancelled by user."
    read -p "Press Enter to continue..."
    exit 1
fi

echo

eliminar_carpeta() {
    local carpeta="$1"
    if [ -d "$carpeta" ]; then
        echo -e "[PROCESSING] Deleting '${carpeta}' folder..."
        rm -rf "$carpeta"
        if [ ! -d "$carpeta" ]; then
            echo -e "${GREEN}[SUCCESS]${NC} '${carpeta}' folder deleted."
        else
            echo -e "${RED}[ERROR]${NC} Failed to delete folder '${carpeta}'."
        fi
    else
        echo -e "[INFO] Folder '${carpeta}' does not exist. Skipping..."
    fi
    echo
}

eliminar_carpeta "input"

eliminar_carpeta "output"

eliminar_carpeta "BatchConfig"

echo "===================================================="
echo "     All specified folders have been"
echo "          processed correctly."
echo "===================================================="
echo
read -p "Press Enter to continue..."
exit 0