diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1699e65..6222568 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,9 @@ on: pull_request: env: DOCKER_COMPOSE_VERSION: 1.24.1 +defaults: + run: + shell: bash jobs: test: strategy: diff --git a/install/geoip.sh b/install/geoip.sh index 8d7c81a..c90b56d 100755 --- a/install/geoip.sh +++ b/install/geoip.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [ ! -f 'install.sh' ]; then echo 'Where are you?'; exit 1; fi +if [[ ! -f 'install.sh' ]]; then echo 'Where are you?'; exit 1; fi source ./install/docker-aliases.sh @@ -25,8 +25,7 @@ install_geoip() { else echo "IP address geolocation is configured for updates." echo "Updating IP address geolocation database ... " - $dcr geoipupdate - if [ $? -gt 0 ]; then + if ! $dcr geoipupdate; then result='Error' fi echo "$result updating IP address geolocation database." diff --git a/install/py2-warning.sh b/install/py2-warning.sh index 5843c3b..2457893 100755 --- a/install/py2-warning.sh +++ b/install/py2-warning.sh @@ -1,27 +1,22 @@ #!/usr/bin/env bash -if [ ! -f 'install.sh' ]; then echo 'Where are you?'; exit 1; fi +if [[ ! -f 'install.sh' ]]; then echo 'Where are you?'; exit 1; fi source ./install/docker-aliases.sh -py2_warning() { - if [[ -n $($dcr --no-deps --entrypoint python web --version | grep 'Python 2') ]]; then - cat <<"EOW" +# Note the stderr>stdout redirection because Python thinks `--version` should +# be on stderr: https://stackoverflow.com/a/31715011/90297 +if $dcr --no-deps --entrypoint python web --version 2>&1 | grep -q 'Python 2'; then + echo " _ _ ____ ____ _ _______ ____ _____ _____ ____ _____ ______ _ _ | || | |_ _| |_ _|/ \ |_ __ \ |_ \|_ _||_ _||_ \|_ _|.' ___ | | || | | || | \ \ /\ / / / _ \ | |__) | | \ | | | | | \ | | / .' \_| | || | | || | \ \/ \/ / / ___ \ | __ / | |\ \| | | | | |\ \| | | | ____ | || | -|_||_| \ /\ /_/ / \ \_ _| | \ \_ _| |_\ |_ _| |_ _| |_\ |_\ `.___] ||_||_| -(_)(_) \/ \/|____| |____||____| |___||_____|\____||_____||_____|\____|`._____.' (_)(_) +|_||_| \ /\ /_/ / \ \_ _| | \ \_ _| |_\ |_ _| |_ _| |_\ |_\ \`.___] ||_||_| +(_)(_) \/ \/|____| |____||____| |___||_____|\____||_____||_____|\____|\`._____.' (_)(_) -EOW - echo 'You are using Sentry with Python 2, which is deprecated.' - echo 'Sentry 21.1 will be the last version with Python 2 support.' - fi -} - -py2_warning -# Run a simple command that would exit with code 0 so the calling script won't think -# there was a failure in this script. (otherwise it fails when Python 2 is *NOT* detected) -# as the exit code for the `grep` call will be `-1` indicating no match found. -echo '' +" + echo '-----------------------------------------------------------' + echo 'You are using Sentry with Python 2, which is deprecated.' + echo 'Sentry 21.1 will be the last version with Python 2 support.' +fi