From aae7fce3d1ebe9afc0c70ff3aba369056c8919a3 Mon Sep 17 00:00:00 2001 From: Casey Marshall Date: Sun, 25 Feb 2024 09:41:18 -0600 Subject: [PATCH] chore: fix uname command for macos --- scripts/install_tools.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/install_tools.sh b/scripts/install_tools.sh index d0cc429..8fb1ae9 100755 --- a/scripts/install_tools.sh +++ b/scripts/install_tools.sh @@ -3,6 +3,7 @@ set -eux # TODO: support windows somehow +UNAME_S=$(uname -s) CAPNP_VERSION="1.0.2" PROTOC_VERSION="24.3" # Keep in sync with veilid-core/build.rs @@ -34,12 +35,18 @@ else exit 1 fi PROTOC_OS="linux" -if [ "$(uname -o)" == "Darwin" ]; then - PROTOC_OS="osx" +if [[ "$UNAME_S" == "Linux" ]]; then + PROTOC_OS=linux +elif [[ "$UNAME_S" == "Darwin" ]]; then + PROTOC_ARCH=osx +else + echo Unsupported OS $UNAME_S + exit 1 fi curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-$PROTOC_OS-$PROTOC_ARCH.zip unzip protoc-$PROTOC_VERSION-$PROTOC_OS-$PROTOC_ARCH.zip +chmod +x bin/* sudo cp -r bin/* /usr/local/bin/ sudo cp -r include/* /usr/local/include/ popd