From 1a0bbae1ac6c0c3d9f13748a6e851272cc698198 Mon Sep 17 00:00:00 2001 From: Ashlen Date: Thu, 4 May 2023 17:45:41 -0600 Subject: [PATCH] updater.sh: adjust printf_color_newline() printf_color() functions by assigning the first positional parameter and shifting it out of the list of parameters. If the interface is misused and the first positional parameter is also the only parameter, what would happen? It is probably better to change both to handle that situation the same way since the code savings is minimal. While here, add back in a newline that was accidentally nuked in the first commit. --- updater.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/updater.sh b/updater.sh index f76f5ca..6066939 100755 --- a/updater.sh +++ b/updater.sh @@ -57,8 +57,9 @@ printf_color() { } printf_color_newline() { - printf_color "$@" - echo + PROVIDED_COLOR="$1" + shift + printf "${PROVIDED_COLOR}%s${NC}\n" "$*" } warn() { @@ -81,6 +82,7 @@ else exit 1 fi + show_banner() { printf_color_newline "${BBLUE}" ' ############################################################################