Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Use sh syntax […] instead bash [[ … ]] for if block

天舟cf931ada4223
diff --git a/build.sh b/build.sh
index c2b0919e8d..14952c9efe 100755
--- a/build.sh
+++ b/build.sh
@@ -19,13 +19,13 @@ fi
OUTPUT_BINARY=$OUTPUT_DIR/bytebase
-if [[ `dirname "${BASH_SOURCE[0]}"` != "." ]]
+if [ `dirname "${BASH_SOURCE[0]}"` != "." ]
then
echo "${RED}Precheck failed.${NC} Build script must run from Bytebase root directory ${SCRIPT_DIR}"; exit 1;
fi
GO_VERSION=`go version | { read _ _ v _; echo ${v#go}; }`
-if [[ "${GO_VERSION}" < "1.16" ]];
+if [ "${GO_VERSION}" < "1.16" ];
then
echo "${RED}Precheck failed.${NC} Require go version >= 1.16. Current version ${GO_VERSION}."; exit 1;
fi
diff --git a/build_bb.sh b/build_bb.sh
index e09ed5ab43..474db759d9 100755
--- a/build_bb.sh
+++ b/build_bb.sh
@@ -19,7 +19,7 @@ fi
OUTPUT_BINARY=$OUTPUT_DIR/bb
-if [[ `dirname "${BASH_SOURCE[0]}"` != "." ]]
+if [ `dirname "${BASH_SOURCE[0]}"` != "." ]
then
echo "${RED}Precheck failed.${NC} Build script must run from Bytebase root directory ${SCRIPT_DIR}"; exit 1;
fi