|
| 1 | +#!/usr/bin/env bash |
1 | 2 | #
|
2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more
|
3 | 4 | # contributor license agreements. See the NOTICE file distributed with
|
|
14 | 15 | # See the License for the specific language governing permissions and
|
15 | 16 | # limitations under the License.
|
16 | 17 | #
|
17 |
| - __ __ __ |
18 |
| - /\ \/\ \ /\ \ __ |
19 |
| - \ \ \/'/' __ __ __ __ __ __\ \ \____/\_\ |
20 |
| - \ \ , < /\ \/\ \/\ \/\ \/\ \/\ \\ \ '__`\/\ \ |
21 |
| - \ \ \\`\\ \ \_\ \ \ \_\ \ \ \_\ \\ \ \L\ \ \ \ |
22 |
| - \ \_\ \_\/`____ \ \____/\ \____/ \ \_,__/\ \_\ |
23 |
| - \/_/\/_/`/___/> \/___/ \/___/ \/___/ \/_/ |
24 |
| - /\___/ |
25 |
| - \/__/ |
| 18 | + |
| 19 | +# Bugzilla 37848: When no TTY is available, don't output to console |
| 20 | +have_tty=0 |
| 21 | +# shellcheck disable=SC2006 |
| 22 | +if [[ "`tty`" != "not a tty" ]]; then |
| 23 | + have_tty=1 |
| 24 | +fi |
| 25 | + |
| 26 | +# Bugzilla 37848: When no TTY is available, don't output to console |
| 27 | +have_tty=0 |
| 28 | +# shellcheck disable=SC2006 |
| 29 | +if [[ "`tty`" != "not a tty" ]]; then |
| 30 | + have_tty=1 |
| 31 | +fi |
| 32 | + |
| 33 | + # Only use colors if connected to a terminal |
| 34 | +if [[ ${have_tty} -eq 1 ]]; then |
| 35 | + RAINBOW=" |
| 36 | + $(printf '\033[38;5;202m') |
| 37 | + $(printf '\033[38;5;226m') |
| 38 | + $(printf '\033[38;5;082m') |
| 39 | + $(printf '\033[38;5;082m') |
| 40 | + $(printf '\033[38;5;163m') |
| 41 | + $(printf '\033[38;5;093m') |
| 42 | + " |
| 43 | + GREEN=$(printf '\033[32m') |
| 44 | + YELLOW=$(printf '\033[33m') |
| 45 | + BLUE=$(printf '\033[34m') |
| 46 | + BLUE=$(printf '\033[34m') |
| 47 | + RESET=$(printf '\033[0m') |
| 48 | +else |
| 49 | + RAINBOW="" |
| 50 | + GREEN="" |
| 51 | + YELLOW="" |
| 52 | + BLUE="" |
| 53 | + BLUE="" |
| 54 | + RESET="" |
| 55 | +fi |
| 56 | + |
| 57 | +print_logo() { |
| 58 | + printf '\n\n' |
| 59 | + printf '%s __ __%s %s %s %s __ %s %s\n' $RAINBOW $RESET |
| 60 | + printf '%s /` \/` \%s %s %s %s /` \ %s __ %s\n' $RAINBOW $RESET |
| 61 | + printf '%s \ \ \/ /%s __ __%s __ __%s __ __%s\ \ \____%s /\_\ %s\n' $RAINBOW $RESET |
| 62 | + printf '%s \ \ , < %s /` \/` \%s/` \/` \%s/` \/` \%s\ \ \__` %s\/` \ %s\n' $RAINBOW $RESET |
| 63 | + printf '%s \ \ \ \`\%s\ \ \_\ \%s\ \_\ \%s\ \_\ \%s\ \ \L\ %s\ \ \ %s\n' $RAINBOW $RESET |
| 64 | + printf '%s \ \_\ \_%s \/`____ \%s \____/ %s\ \____`%s\ \_,__/ %s\ \_\ %s\n' $RAINBOW $RESET |
| 65 | + printf '%s \/_/\/_/%s `/___/> \%s/___/ %s\/___/ %s\/___/ %s\/_/ %s\n' $RAINBOW $RESET |
| 66 | + printf '%s %s /\___/ %s %s %s %s %s\n' $RAINBOW $RESET |
| 67 | + printf '%s %s \/__\/ %s %s %s %s %s\n' $RAINBOW $RESET |
| 68 | + printf '\n\n' |
| 69 | +} |
| 70 | + |
| 71 | +print_logo |
| 72 | + |
0 commit comments