run shellfmt on all of lib

This commit is contained in:
Ricardo Pardini
2022-10-08 13:17:30 +02:00
parent 76dac6f428
commit 85c8cbf15d
45 changed files with 1723 additions and 1829 deletions

View File

@@ -1,8 +1,7 @@
#--------------------------------------------------------------------------------------------------------------------------------
# Let's have unique way of displaying alerts
#--------------------------------------------------------------------------------------------------------------------------------
display_alert()
{
display_alert() {
# log function parameters to install.log
[[ -n "${DEST}" ]] && echo "Displaying message: $@" >> "${DEST}"/${LOG_SUBPATH}/output.log
@@ -11,24 +10,24 @@ display_alert()
case $3 in
err)
echo -e "[\e[0;31m error \x1B[0m] $1 $tmp"
;;
echo -e "[\e[0;31m error \x1B[0m] $1 $tmp"
;;
wrn)
echo -e "[\e[0;35m warn \x1B[0m] $1 $tmp"
;;
echo -e "[\e[0;35m warn \x1B[0m] $1 $tmp"
;;
ext)
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0m $tmp"
;;
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0m $tmp"
;;
info)
echo -e "[\e[0;32m o.k. \x1B[0m] $1 $tmp"
;;
echo -e "[\e[0;32m o.k. \x1B[0m] $1 $tmp"
;;
*)
echo -e "[\e[0;32m .... \x1B[0m] $1 $tmp"
;;
echo -e "[\e[0;32m .... \x1B[0m] $1 $tmp"
;;
esac
}
@@ -38,8 +37,7 @@ display_alert()
# The LOG_OUTPUT_FILE variable must be defined in the calling function
# before calling the `show_checklist_variables` function and unset after.
#
show_checklist_variables ()
{
show_checklist_variables() {
local checklist=$*
local var pval
local log_file=${LOG_OUTPUT_FILE:-"${SRC}"/output/${LOG_SUBPATH}/trash.log}
@@ -47,15 +45,15 @@ show_checklist_variables ()
local _function=${FUNCNAME[1]}
local _file=$(basename "${BASH_SOURCE[1]}")
echo -e "Show variables in function: $_function" "[$_file:$_line]\n" >>$log_file
echo -e "Show variables in function: $_function" "[$_file:$_line]\n" >> $log_file
for var in $checklist;do
for var in $checklist; do
eval pval=\$$var
echo -e "\n$var =:" >>$log_file
if [ $(echo "$pval" | awk -F"/" '{print NF}') -ge 4 ];then
printf "%s\n" $pval >>$log_file
echo -e "\n$var =:" >> $log_file
if [ $(echo "$pval" | awk -F"/" '{print NF}') -ge 4 ]; then
printf "%s\n" $pval >> $log_file
else
printf "%-30s %-30s %-30s %-30s\n" $pval >>$log_file
printf "%-30s %-30s %-30s %-30s\n" $pval >> $log_file
fi
done
}