浏览代码

Better error suppresion when getting terminal colours (#7739)

Co-authored-by: Richard Lyons <frob@cloudstaff.com>
frob 5 月之前
父节点
当前提交
e66c29261a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scripts/install.sh

+ 2 - 2
scripts/install.sh

@@ -4,8 +4,8 @@
 
 set -eu
 
-red="$( (/usr/bin/tput bold; /usr/bin/tput setaf 1; :) 2>&-)"
-plain="$( (/usr/bin/tput sgr0; :) 2>&-)"
+red="$( (/usr/bin/tput bold || :; /usr/bin/tput setaf 1 || :) 2>&-)"
+plain="$( (/usr/bin/tput sgr0 || :) 2>&-)"
 
 status() { echo ">>> $*" >&2; }
 error() { echo "${red}ERROR:${plain} $*"; exit 1; }