mirror of
https://github.com/JackHack96/EasyEffects-Presets.git
synced 2024-11-21 13:20:09 +00:00
Merge pull request #25 from Jojodicus/patch-1
handle invalid input (fix #22)
This commit is contained in:
commit
ac0228da6b
1 changed files with 8 additions and 4 deletions
12
install.sh
12
install.sh
|
@ -22,15 +22,19 @@ check_impulse_response_directory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
read_choice() {
|
read_choice() {
|
||||||
CHOICE=""
|
while :; do
|
||||||
while [[ ! $CHOICE =~ ^[1-5]+$ ]]; do
|
|
||||||
read -r CHOICE
|
read -r CHOICE
|
||||||
if [ "$CHOICE" -lt 1 ] || [ "$CHOICE" -gt 5 ]; then
|
if [ -z "$CHOICE" ]; then
|
||||||
echo "Invalid option! Please input a value between 1 and 5!"
|
CHOICE=1 #default
|
||||||
fi
|
fi
|
||||||
|
if [[ $CHOICE =~ ^[1-5]+$ ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Invalid option! Please input a value between 1 and 5!"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
install_menu(){
|
install_menu(){
|
||||||
echo "Please select an option for presets installation (Default=1)"
|
echo "Please select an option for presets installation (Default=1)"
|
||||||
echo "1) Install all presets"
|
echo "1) Install all presets"
|
||||||
|
|
Loading…
Reference in a new issue