test: Set default column size if $TERM env var isn't set

Seems Github actions breaks or unsets this, leading to the errors:

tput: No value for $TERM and no -T specified
seq: missing operand
Try 'seq --help' for more information.

Hopefully this makes things a bit more robust.
This commit is contained in:
James Shubin
2021-02-17 04:07:30 -05:00
parent 400b58c0e9
commit e7ef0f7a6c

View File

@@ -18,7 +18,8 @@ if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
exit 1 exit 1
fi fi
LINE=$(printf '=%.0s' `seq -s ' ' $(tput cols)`) # a terminal width string COLS="$(tput cols 2>/dev/null || echo 80)" # github-actions has no $TERM
LINE=$(printf '=%.0s' `seq -s ' ' $COLS`) # a terminal width string
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" # dir! DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" # dir!
cd "$DIR" >/dev/null # work from main mgmt directory cd "$DIR" >/dev/null # work from main mgmt directory
failures="" failures=""