diff --git a/install.sh b/install.sh index 4bd5bd3..3019e25 100755 --- a/install.sh +++ b/install.sh @@ -67,17 +67,17 @@ function sudo_root { ## MAIN set -Eeuo pipefail -assert_supported_distro -assert_bash -sudo_root - -if [[ ! -v MIAOU_BASH_DIR ]]; then - MIAOU_BASH_DIR=/opt/miaou-bash - export MIAOU_BASH_DIR -fi +if assert_supported_distro && assert_bash && sudo_root; then + if [[ ! -v MIAOU_BASH_DIR ]]; then + MIAOU_BASH_DIR=/opt/miaou-bash + export MIAOU_BASH_DIR + fi -deployment_type_adjective="${1:-installed}" # `miaou-bash --self-upgrade` provides the 'upgrade' term -if once_installed; then upgrade; else install; fi -if [[ $deployment_type_adjective == 'installed' ]]; then - exec bash -l + deployment_type_adjective="${1:-installed}" # `miaou-bash --self-upgrade` provides the 'upgrade' term + if once_installed; then upgrade; else install; fi + if [[ $deployment_type_adjective == 'installed' ]]; then + exec bash -l + fi +else + >&2 echo "MIAOU_BASH_ERROR: requirements failure" fi