Skip to content

Commit

Permalink
FIX | get_php_versions | conditions for choice
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiMazurBeetroot committed Dec 21, 2022
1 parent 2e66758 commit e591791
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env-core/sh/projects/setup/setup_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ get_php_versions() {

((++i))
read -rp "$(ECHO_YELLOW "Please select one of:")" choice
choice=${choice%.*}

[ -z "$choice" ] && choice=-1
if (("$choice" > 0 && "$choice" <= $i)); then
PHP_VERSION="${PHP_LIST[$(($choice - 1))]}"
else
EMPTY_LINE
PHP_VERSION="${PHP_LIST[1]}"
ECHO_WARN_RED "This version of PHP does not support"
ECHO_GREEN "Set default version: $PHP_VERSION"
EMPTY_LINE
fi
fi
fi
Expand Down

0 comments on commit e591791

Please sign in to comment.