Skip to content

Fix: Enclose variables in double quotes #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/linux/download-cpp-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ set -e -x
ROOT_DIR=`cd $(dirname $0) && cd ../../ && pwd`
source $ROOT_DIR/pulsar-client-cpp.txt

if [ $USER != "root" ]; then
if [ "$USER" != "root" -a "$USER" != "" ]; then
SUDO="sudo"
fi

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

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

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

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

Expand Down
Loading