From e74f79bb7ea73b3f9f9afbde57426a6178142f2a Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 18 Apr 2024 12:46:53 -0400 Subject: [PATCH] tools: Make update-stubs script work in CI (#36931) I tried to get a little too fancy and the script isn't working in CI when unzipping. Check for whether we have a terminal on stdout before trying to do the fanciness. --- tools/stubs/update-stubs.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/stubs/update-stubs.sh b/tools/stubs/update-stubs.sh index 2aa5a9cee421f..d63a512e711ab 100755 --- a/tools/stubs/update-stubs.sh +++ b/tools/stubs/update-stubs.sh @@ -44,10 +44,14 @@ function fetch_plugin { echo "Unzipping..." local D=$PWD cd "$WORK_DIR" - cols=$( tput cols ) - unzip "$slug.zip" | while read -r line; do - printf '\r\e[0K%.*s' "$cols" "$line" - done + if [[ -n "$TERM" && -t 1 ]]; then + cols=$( tput cols ) + unzip "$slug.zip" | while read -r line; do + printf '\r\e[0K%.*s' "$cols" "$line" + done + else + unzip "$slug.zip" + fi cd "$D" printf '\r\e[0KDone!\n' }