From afd7491ae800530e043986039b61cf6ba2ee113e Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Tue, 29 Nov 2022 22:17:49 +0800 Subject: [PATCH] bug fix --- tools/common.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/common.sh b/tools/common.sh index 91c81cf..4288319 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -148,7 +148,9 @@ ask_for_Yn() post_log() { - test $# -eq 3 || fmt_fatal "usage: post_log
" + if [[ $# != 3 || -z "$1" || -z "$2" || -z "$3" ]]; then + fmt_fatal "usage: post_log
" + fi "${DOTFILES}/tools/logger.sh" "log" "[$1][$2] $3" } @@ -159,7 +161,9 @@ apost_log() post_beacon() { - test $# -eq 1 || fmt_fatal "usage: post_beacon " + if [[ $# != 1 || -z "$1" ]]; then + fmt_fatal "usage: post_beacon " + fi "${DOTFILES}/tools/logger.sh" "beacon" "$1" }