Closed
Description
When I use which_r in the devel branch on codespace and choose R, I can enter incorrect numbers without it being caught.

I would expect if choosing a value higher than the environments to have a warning. Maybe a simple add an else to the blocks in lines 36 - 40:
'''
if [[ ! "$choice" =~ ^[1-9]$ ]]; then
echo "Invalid choice. Please enter a number between 1 and $(($counter - 1))"
exit 1
elif [[ "$choice" > $counter ]]; then
echo "Invalid choice. Please enter a number between 1 and $(($counter - 1))"
exit 1
fi
'''
?
Otherwise the script returns with a path to an R` that does not exist.
Metadata
Metadata
Assignees
Labels
No labels