From d8dbcbbec6ebd9cf979827a9d72c76d11fff3e4f Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751@qq.com> Date: Thu, 12 Oct 2023 10:45:41 +0800 Subject: [PATCH] eplace `-v` Operator to Ensure Compatibility (#1185) 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 ee67922900..2e53ae5aef 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