From a4a089aaf08095110f6f65335995b1c53a5d7a05 Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751@qq.com> Date: Thu, 12 Oct 2023 00:18:39 +0800 Subject: [PATCH] eplace `-v` Operator to Ensure Compatibility Replaced the `-v` operator with a more universally compatible method for variable checking in the bash script. The update uses parameter expansion to check if a variable is set, ensuring the script runs smoothly on environments with different Bash versions. Issue: https://github.com/openimsdk/open-im-server/issues/1182 --- scripts/lib/color.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/color.sh b/scripts/lib/color.sh index ee6792290..2e53ae5ae 100755 --- a/scripts/lib/color.sh +++ b/scripts/lib/color.sh @@ -20,7 +20,7 @@ ################################################################################ # shellcheck disable=SC2034 -if [[ ! -v COLOR_OPEN ]]; then +if [ -z "${COLOR_OPEN+x}" ]; then COLOR_OPEN=1 fi