1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 13:16:47 +00:00

fix: correctly parse comma-separated indices for batch uninstall selection

This commit is contained in:
Tw93
2025-10-05 19:16:11 +08:00
parent 80e3c0c792
commit 53bb2751a3

View File

@@ -59,8 +59,8 @@ select_apps_for_uninstall() {
selected_apps=()
# Parse indices and build selected apps array
# Convert space-separated string to array for better handling
read -a indices_array <<< "$MOLE_SELECTION_RESULT"
# MOLE_SELECTION_RESULT is comma-separated list of indices from the paginated menu
IFS=',' read -r -a indices_array <<< "$MOLE_SELECTION_RESULT"
for idx in "${indices_array[@]}"; do
if [[ "$idx" =~ ^[0-9]+$ ]] && [[ $idx -ge 0 ]] && [[ $idx -lt ${#apps_data[@]} ]]; then