Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aranjans committed Apr 16, 2024
1 parent b267bf1 commit 77e1166
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions scripts/protoc_installer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#!/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

source "$(dirname $0)/vet-common.sh"

# 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 +44,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 \
https://github.com/protocolbuffers/protobuf/releases/ and add to PATH" ;;
esac
}

0 comments on commit 77e1166

Please sign in to comment.