mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
fix: Display installation mode menu in Install-Claude.sh
- Redirect menu prompts to stderr to prevent capture by command substitution - Fixes issue where installation options were not visible to user - Menu now displays correctly: "Global" and "Path" installation modes Issue: When get_user_choice output was captured by $(command), the menu display was suppressed because stdout was being captured. Solution: Output all user-facing prompts to stderr (&2) while keeping the selected value on stdout for function return. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -119,19 +119,22 @@ function get_user_choice() {
|
|||||||
local default_index=0
|
local default_index=0
|
||||||
|
|
||||||
if [ "$NON_INTERACTIVE" = true ]; then
|
if [ "$NON_INTERACTIVE" = true ]; then
|
||||||
write_color "Non-interactive mode: Using default '${options[$default_index]}'" "$COLOR_INFO"
|
write_color "Non-interactive mode: Using default '${options[$default_index]}'" "$COLOR_INFO" >&2
|
||||||
echo "${options[$default_index]}"
|
echo "${options[$default_index]}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
# Output prompts to stderr so they don't interfere with function return value
|
||||||
write_color "$prompt" "$COLOR_PROMPT"
|
echo "" >&2
|
||||||
echo ""
|
write_color "$prompt" "$COLOR_PROMPT" >&2
|
||||||
|
echo "" >&2
|
||||||
|
|
||||||
for i in "${!options[@]}"; do
|
for i in "${!options[@]}"; do
|
||||||
echo " $((i + 1)). ${options[$i]}"
|
echo " $((i + 1)). ${options[$i]}" >&2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "" >&2
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Please select (1-${#options[@]}): " choice
|
read -p "Please select (1-${#options[@]}): " choice
|
||||||
|
|
||||||
@@ -140,7 +143,7 @@ function get_user_choice() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
write_color "Invalid selection. Please enter a number between 1 and ${#options[@]}" "$COLOR_WARNING"
|
write_color "Invalid selection. Please enter a number between 1 and ${#options[@]}" "$COLOR_WARNING" >&2
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user