Skip to content

Commit 54a14d9

Browse files
authored
Arm backend: Suppress colors in pre-push if non-interactive (#10783)
Dont try to print with colors in the pre-push script if the script is non-interactive. This is to avoid getting broken output in the CI which doesnt support colors. Signed-off-by: [email protected]
1 parent 6759d35 commit 54a14d9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

backends/arm/scripts/pre-push

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
# non-interactive mode. "$#" gives the number of positional arguments.
99
[ "$#" -eq 0 ] && is_script_interactive=1 || is_script_interactive=0
1010

11-
RESET='\e[0m'
12-
RED='\e[31m'
13-
GREEN='\e[32m'
14-
YELLOW='\e[33m'
15-
BLUE='\e[34m'
11+
if [ $is_script_interactive -eq 1 ]; then
12+
RESET='\e[0m'
13+
RED='\e[31m'
14+
GREEN='\e[32m'
15+
YELLOW='\e[33m'
16+
BLUE='\e[34m'
17+
fi
1618

1719
INFO="${BLUE}[INFO]${RESET}"
1820
WARNING="${YELLOW}[WARNING]${RESET}"

0 commit comments

Comments
 (0)