Skip to content

Commit

Permalink
tools: Make update-stubs script work in CI (#36931)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anomiex authored Apr 18, 2024
1 parent e743347 commit e74f79b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/stubs/update-stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down

0 comments on commit e74f79b

Please sign in to comment.