From ba58997b9f21f26fc7bec8eb1241eadee7342b7d Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 26 Mar 2020 03:25:54 -0600 Subject: [PATCH] don't use tput if it's not installed --- borghelper.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/borghelper.sh b/borghelper.sh index 6058602..8d58b94 100755 --- a/borghelper.sh +++ b/borghelper.sh @@ -25,9 +25,15 @@ trapExit () { ### text formatting presets -err=$(tput bold)$(tput setaf 1) -norm=$(tput sgr0) -width=$(tput cols) +if command -v tput > /dev/null; then + err=$(tput bold)$(tput setaf 1) + norm=$(tput sgr0) + width=$(tput cols) +else + err="[ERROR] " + norm="" + width=80 +fi ### pre-requisites