Skip to content

Commit df19677

Browse files
committed
fix install when only 1 option is selected
1 parent 77e3b36 commit df19677

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

install.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,20 @@ setup_agent_comfy() {
437437

438438
# Get user selections
439439
SELECTED_OPTIONS=()
440-
while IFS= read -r option; do
441-
SELECTED_OPTIONS+=("$option")
442-
done < <(gum choose --no-limit --height 13 --cursor.foreground="#FFA500" "${MENU_OPTIONS[@]}")
440+
SELECTIONS=$(gum choose --no-limit --height 12 --cursor.foreground="#FFA500" "${MENU_OPTIONS[@]}")
441+
if [ -n "$SELECTIONS" ]; then
442+
# Use mapfile to read selections into array, handling both single and multiple selections
443+
mapfile -t SELECTED_OPTIONS <<< "$SELECTIONS"
444+
fi
445+
446+
# Debugging: Print selected options
447+
# echo "Selected options: ${SELECTED_OPTIONS[*]}"
443448

444449
# Exit if no selection
445-
if [ ${#SELECTED_OPTIONS[@]} -eq 0 ] || [ -z "${SELECTED_OPTIONS[0]}" ]; then
446-
echo "No functionality selected. Exiting setup."
447-
exit 1
448-
fi # Changed from single-line syntax for clarity
450+
if [ ${#SELECTED_OPTIONS[@]} -eq 0 ]; then
451+
echo "No models selected. Exiting."
452+
exit 0
453+
fi
449454

450455
# Process selections for DEFAULT_MODELS
451456
SELECTED_MODEL_IDS=""

0 commit comments

Comments
 (0)