|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
3 | | -if [ ! -f 'install.sh' ]; then echo 'Where are you?'; exit 1; fi |
| 3 | +if [[ ! -f 'install.sh' ]]; then echo 'Where are you?'; exit 1; fi |
4 | 4 |
|
5 | 5 | source ./install/docker-aliases.sh |
6 | 6 |
|
7 | | -py2_warning() { |
8 | | - if [[ -n $($dcr --no-deps --entrypoint python web --version | grep 'Python 2') ]]; then |
9 | | - cat <<"EOW" |
| 7 | +# Note the stderr>stdout redirection because Python thinks `--version` should |
| 8 | +# be on stderr: https://stackoverflow.com/a/31715011/90297 |
| 9 | +if $dcr --no-deps --entrypoint python web --version 2>&1 | grep -q 'Python 2'; then |
| 10 | + echo " |
10 | 11 | _ _ ____ ____ _ _______ ____ _____ _____ ____ _____ ______ _ _ |
11 | 12 | | || | |_ _| |_ _|/ \ |_ __ \ |_ \|_ _||_ _||_ \|_ _|.' ___ | | || | |
12 | 13 | | || | \ \ /\ / / / _ \ | |__) | | \ | | | | | \ | | / .' \_| | || | |
13 | 14 | | || | \ \/ \/ / / ___ \ | __ / | |\ \| | | | | |\ \| | | | ____ | || | |
14 | | -|_||_| \ /\ /_/ / \ \_ _| | \ \_ _| |_\ |_ _| |_ _| |_\ |_\ `.___] ||_||_| |
15 | | -(_)(_) \/ \/|____| |____||____| |___||_____|\____||_____||_____|\____|`._____.' (_)(_) |
| 15 | +|_||_| \ /\ /_/ / \ \_ _| | \ \_ _| |_\ |_ _| |_ _| |_\ |_\ \`.___] ||_||_| |
| 16 | +(_)(_) \/ \/|____| |____||____| |___||_____|\____||_____||_____|\____|\`._____.' (_)(_) |
16 | 17 |
|
17 | | -EOW |
18 | | - echo 'You are using Sentry with Python 2, which is deprecated.' |
19 | | - echo 'Sentry 21.1 will be the last version with Python 2 support.' |
20 | | - fi |
21 | | -} |
22 | | - |
23 | | -py2_warning |
24 | | -# Run a simple command that would exit with code 0 so the calling script won't think |
25 | | -# there was a failure in this script. (otherwise it fails when Python 2 is *NOT* detected) |
26 | | -# as the exit code for the `grep` call will be `-1` indicating no match found. |
27 | | -echo '' |
| 18 | +" |
| 19 | + echo '-----------------------------------------------------------' |
| 20 | + echo 'You are using Sentry with Python 2, which is deprecated.' |
| 21 | + echo 'Sentry 21.1 will be the last version with Python 2 support.' |
| 22 | +fi |
0 commit comments