From 6593a71c933a38912ba9ecea809ada13fdb480eb Mon Sep 17 00:00:00 2001 From: rohansen856 Date: Wed, 23 Oct 2024 00:11:05 +0530 Subject: [PATCH] Added more colored output to upgrade script --- scripts/upgrade-zulip | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade-zulip b/scripts/upgrade-zulip index c46d7132ea..7670762a13 100755 --- a/scripts/upgrade-zulip +++ b/scripts/upgrade-zulip @@ -5,9 +5,15 @@ set -e +# Colors +FAIL='\033[91m' +GREEN='\x1b[32m' +WARNING="\033[93m" +ENDC='\033[0m' # No Color + if [ "$EUID" -ne 0 ]; then basename=$(basename "$0") - echo "Error: $basename must be run as root." >&2 + echo -e "${FAIL}Error: $basename must be run as root.${ENDC}" >&2 exit 1 fi @@ -15,12 +21,14 @@ fi failed=${PIPESTATUS[0]} if [ "$failed" -ne 0 ]; then - echo -e '\033[0;31m' + echo -e "${FAIL}" echo "Zulip upgrade failed (exit code $failed)!" echo echo -n "The upgrade process is designed to be idempotent, so you can retry " echo -n "after resolving whatever issue caused the failure (there should be a traceback above). " echo -n "A log of this installation is available in /var/log/zulip/upgrade.log" - echo -e '\033[0m' + echo -e "${ENDC}" exit "$failed" +else + echo -e "${GREEN}Zulip upgrade completed successfully!${ENDC}" fi