Skip to content

Commit e75360f

Browse files
committed
[fix] : Fixed shellcheck warning
1 parent 978194c commit e75360f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tools/msg.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
set -eu
44

5-
script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )"
6-
75
msgsh="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )/$(basename "${0}")"
86

97
msg_type="info"
108
echo_opts=()
119
bash_debug=false
1210
nocolor=false
1311

14-
1512
# appname
1613
appname="msg.sh"
1714
noappname=false
@@ -91,6 +88,7 @@ text() {
9188
f) _decotypes="${_decotypes};5" ;;
9289
l) _decotypes="${_decotypes};4" ;;
9390
n) _decotypes="${_decotypes};0" ;;
91+
*) msg_error "Wrong use of text function" ;;
9492
esac
9593
done
9694
shift "$((OPTIND - 1))"
@@ -286,15 +284,16 @@ case "${1-""}" in
286284
esac
287285

288286
word_count="${#msg_label}"
289-
message="${@}"
287+
message="${*}"
290288

291289
echo_type() {
292-
local i
293290
if [[ "${nolabel}" = false ]]; then
294291
if [[ "${noadjust}" = false ]]; then
295-
for i in $( seq 1 "$(( label_space - word_count))" ); do
296-
echo -ne "${adjust_chr}"
297-
done
292+
yes "${adjust_chr}" 2> /dev/null | head -n "$(( label_space - word_count))" | tr -d "\n"
293+
#local i
294+
#for i in $( seq 1 "$(( label_space - word_count))" ); do
295+
# echo -ne "${adjust_chr}"
296+
#done
298297
fi
299298
text -c "${labelcolor}" "${msg_label}"
300299
fi
@@ -308,7 +307,7 @@ echo_appname() {
308307

309308
# echo_message <message>
310309
echo_message() {
311-
if [[ "${textcolor}" = "white" ]]; then
310+
if [[ "${customized_text_color}" = false ]]; then
312311
text -n "${1}"
313312
else
314313
text -c "${textcolor}" "${1}"

0 commit comments

Comments
 (0)