Skip to content

Commit

Permalink
fix(#9686): require valid input on core version in docker helper (#9687)
Browse files Browse the repository at this point in the history
Co-authored-by: Sugat Bajracharya <[email protected]>
  • Loading branch information
mrjones-plip and sugat009 authored Dec 4, 2024
1 parent ca0db92 commit 0e548d2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/docker-helper-4.x/cht-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ if [[ -z "$projectName" ]]; then

echo
# thanks for the pr vs rp!! https://unix.stackexchange.com/a/677805
read -rp "Would you like to initialize a new project [y/N]?" yn
read -rp "Would you like to initialize a new project [y/N]? " yn
case $yn in
[Yy]*)
while [[ -z "$projectName" ]]; do
Expand All @@ -408,10 +408,19 @@ if [[ -z "$projectName" ]]; then
case $runLatest in
[nN]*)
allKnownVersions=$(get_all_known_versions)
optionCount=$(wc -l <<< "$allKnownVersions")
echo
echo "Which version to you want to run? (ctrl + c to quit)"
select preferredRelease in $allKnownVersions; do
break
echo "Select a version by entering 1 through ${optionCount} or 'ctrl + c' to quit: "
while true; do
select preferredRelease in $allKnownVersions; do
if [[ "$REPLY" =~ ^[0-9]+$ && "$REPLY" -gt 0 && "$REPLY" -lt $optionCount ]]; then
echo
echo "Selected version ${preferredRelease}";
break 2;
else
echo "Invalid choice. Enter 1 through ${optionCount} or 'ctrl + c' to quit"
fi
done
done
esac
echo
Expand Down

0 comments on commit 0e548d2

Please sign in to comment.