unified: abort install when non-bash shell detected

On Debian variants, sh -x ./install.sh will fail since our script in
written in bash, and /bin/sh in Debian variants is dash, not bash.

So detect non-bash shell and print error message, let users to run in
bash.

Fixes #8479

Closes #8484
This commit is contained in:
Takuya ASADA
2021-04-14 23:32:06 +09:00
committed by Piotr Sarna
parent 935378fa53
commit cbbd5b2b6f
3 changed files with 15 additions and 0 deletions

View File

@@ -22,6 +22,11 @@
set -e
if [ -z "$BASH_VERSION" ]; then
echo "Unsupported shell, please run this script on bash."
exit 1
fi
print_usage() {
cat <<EOF
Usage: install.sh [options]

View File

@@ -22,6 +22,11 @@
set -e
if [ -z "$BASH_VERSION" ]; then
echo "Unsupported shell, please run this script on bash."
exit 1
fi
print_usage() {
cat <<EOF
Usage: install.sh [options]

View File

@@ -22,6 +22,11 @@
set -e
if [ -z "$BASH_VERSION" ]; then
echo "Unsupported shell, please run this script on bash."
exit 1
fi
# change directory to the package's root directory
cd "$(dirname "$0")"