Skip to content

Commit cfb4795

Browse files
committed
Enclose variables in double quotes
1 parent b79ead0 commit cfb4795

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/linux/download-cpp-client.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ set -e -x
2323
ROOT_DIR=`cd $(dirname $0) && cd ../../ && pwd`
2424
source $ROOT_DIR/pulsar-client-cpp.txt
2525

26-
if [ $USER != "root" ]; then
26+
if [ "$USER" != "root" ]; then
2727
SUDO="sudo"
2828
fi
2929

3030
# Get the flavor of Linux
3131
export $(cat /etc/*-release | grep "^ID=")
3232
UNAME_ARCH=$(uname -m)
33-
if [ $UNAME_ARCH == 'aarch64' ]; then
33+
if [ "$UNAME_ARCH" == 'aarch64' ]; then
3434
PLATFORM=arm64
3535
else
3636
PLATFORM=x86_64
@@ -42,18 +42,18 @@ rm -rf $ROOT_DIR/pkg/linux/tmp
4242
mkdir $ROOT_DIR/pkg/linux/tmp
4343
cd $ROOT_DIR/pkg/linux/tmp
4444

45-
if [ $ID == 'ubuntu' -o $ID == 'debian' ]; then
45+
if [ "$ID" == 'ubuntu' -o "$ID" == 'debian' ]; then
4646
curl -L -O ${CPP_CLIENT_BASE_URL}/deb-${PLATFORM}/apache-pulsar-client-dev.deb
4747
$SUDO ar x apache-pulsar-client-dev.deb
4848
$SUDO tar -xvf data.tar.xz
4949
cp -r usr/* $ROOT_DIR/pkg/linux/pulsar-cpp/
5050

51-
elif [ $ID == 'alpine' ]; then
51+
elif [ "$ID" == 'alpine' ]; then
5252
curl -L -O ${CPP_CLIENT_BASE_URL}/apk-${PLATFORM}/${UNAME_ARCH}/apache-pulsar-client-dev-${CPP_CLIENT_VERSION}-r0.apk
5353
$SUDO tar -xvf apache-pulsar-client-dev-${CPP_CLIENT_VERSION}-r0.apk
5454
cp -r usr/* $ROOT_DIR/pkg/linux/pulsar-cpp/
5555

56-
elif [ $ID == '"centos"' -o $ID == '"rocky"' ]; then
56+
elif [ "$ID" == '"centos"' -o "$ID" == '"rocky"' ]; then
5757
curl -L -O ${CPP_CLIENT_BASE_URL}/rpm-${PLATFORM}/${UNAME_ARCH}/apache-pulsar-client-devel-${CPP_CLIENT_VERSION}-1.${UNAME_ARCH}.rpm
5858
$SUDO rpm -i --prefix=$ROOT_DIR/pkg/linux/pulsar-cpp apache-pulsar-client-devel-${CPP_CLIENT_VERSION}-1.${UNAME_ARCH}.rpm --nodeps --force
5959

0 commit comments

Comments
 (0)