Merge pull request #8314 from kasper3/patch-1

Check if tput command exists before using it
This commit is contained in:
John Beisner 2018-01-02 14:20:40 -08:00 committed by GitHub
commit ecdaa669eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -6,8 +6,6 @@
# Dockerfile that creates a container suitable to build dotnet-cli
FROM microsoft/dotnet-buildtools-prereqs:alpine-3.6-3148f11-20171119021156
RUN apk add --no-cache sudo ncurses
# This Dockerfile doesn't use the USER_ID, but the parameter needs to be declared to prevent docker
# from issuing a warning
ARG USER_ID=0

View file

@ -22,7 +22,7 @@ exec 3>&1
# Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors.
# See if stdout is a terminal
if [ -t 1 ]; then
if [ -t 1 ] && command -v tput > /dev/null; then
# see if it supports colors
ncolors=$(tput colors)
if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then