Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aranjans committed Apr 12, 2024
1 parent b267bf1 commit 3d6b829
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions scripts/protoc_installer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/bin/bash
# Install protoc
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#set -eu -o pipefail

# Perform installation of protoc from source based on OS.

PROTOC_VERSION="25.2"

# Function to download pre-built binaries for Linux with
Expand All @@ -25,10 +42,10 @@ install_protoc() {
die "Unsupported architecture. Please consider manual installation."
fi
# Detect the Operating System
OS=$(uname -s)
case "$OS" in
case "$(uname -s)" in
"Darwin") download_binary $ARCH "osx" "$1";;
"Linux") download_binary $ARCH "linux" $1;;
*) echo "Unsupported operating system. Please consider manual installation." ;;
*) echo "Please consider manual installation from \
protocolbuffers/protobuf/releases and add to PATH" ;;
esac
}

0 comments on commit 3d6b829

Please sign in to comment.