diff --git a/main.sh b/main.sh index 105a922..204d33a 100644 --- a/main.sh +++ b/main.sh @@ -1,10 +1,24 @@ #!/usr/bin/env bash -inverse="$(tput setab 7)$(tput setaf 0)" -success="$(tput setab 2)$(tput bold)" -error="$(tput setab 1)$(tput bold)" -underline=$(tput smul) -reset=$(tput sgr0) +# Configure styling +if [[ -n "$TERM" ]] +then + inverse="$(tput setab 7)$(tput setaf 0)" + bold="$(tput bold)" + success="$(tput setab 2)$bold" + info="$(tput setaf 6)$bold" + warning="$(tput setaf 3)$bold" + error="$(tput setab 1)$bold" + reset=$(tput sgr0) +else + inverse="" + bold="[[" + success="[[" + info="[[" + warning="[[" + error="[[" + reset="]]" +fi export BOG_TITLE_PRINTED=0 @@ -46,7 +60,7 @@ footer () { section () { read title echo ":::::" - echo ":(*) $title..." + echo ":$bold(*) $title...$reset" } result () { @@ -54,9 +68,9 @@ result () { if [ $exit_code -eq 0 ] then - echo ":)=> $success Ok $reset ****" + echo ":)=> $success Ok $reset" else - echo ":(!> $error Error $reset ****" + echo ":(!> $error Error $reset" fi } @@ -71,13 +85,13 @@ output () { output::warning () { while read line do - echo "::: $line" + echo ":::$warning$reset $line" done } output::info () { while read line do - echo "::: $line" + echo ":::$info$reset $line" done }