Moved line declaration out of tty conditional

This way it will always be set to ""
This commit is contained in:
James Conroy
2021-12-08 18:18:27 -06:00
parent ac5527e1ab
commit 2993a20947

View File

@@ -180,6 +180,7 @@ print_line() {
local service_name="${1}" local service_name="${1}"
local service_state="" ; service_state="$( parse_status "${1}" "${2}" )" local service_state="" ; service_state="$( parse_status "${1}" "${2}" )"
# XXX: What will we do if tput isn't avalable? # XXX: What will we do if tput isn't avalable?
local line=""
if (( __tty == 1 )); then if (( __tty == 1 )); then
local NC; NC="$(tput sgr0)" # no color local NC; NC="$(tput sgr0)" # no color
local red=""; red="$(tput setaf 1 bold)" local red=""; red="$(tput setaf 1 bold)"
@@ -192,7 +193,6 @@ print_line() {
local columns ; columns=$(tput cols) local columns ; columns=$(tput cols)
linewidth=$(( columns - PADDING_CONSTANT - ${#service_name} - ${#service_state} )) linewidth=$(( columns - PADDING_CONSTANT - ${#service_name} - ${#service_state} ))
local line=""
for i in $(seq 0 "${linewidth}"); do for i in $(seq 0 "${linewidth}"); do
line="${line}-" line="${line}-"
done done