diff options
author | Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> | 2020-05-01 07:33:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-01 10:33:28 -0400 |
commit | 8d4ab4555cbf026ea2c34ea4800f72dcd1fe4c8e (patch) | |
tree | 660100cddf3c55ae8bf840b21741b01e0a1fe75c /install.sh | |
parent | d5f62e135552110a6bf47559fb4c57e935171361 (diff) |
Improve the yes/no prompt in install.sh (#683)
* Improve the yes/no prompt in install.sh
The old implementation used a feature only present on Bash version 4, which not all systems have. The new version should work on all bash shells.
* Update install.sh
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -16,10 +16,10 @@ init_db_final=0 while [ "$init_db_valid" == 0 ] do read -p "Initialize database (y/n)? " init_db - case "${init_db,,}" in - y|yes ) init_db_valid=1; init_db_final=1;; - n|no ) init_db_valid=1; init_db_final=0;; - * ) echo "Invalid input" 1>&2;; + case "$init_db" in + [yY]* ) init_db_valid=1; init_db_final=1;; + [nN]* ) init_db_valid=1; init_db_final=0;; + * ) echo "Invalid input. Please enter either \"y\" or \"n\"." 1>&2;; esac echo done |