Skip to content

Commit b3106cc

Browse files
committed
Refactor
1 parent b267bf1 commit b3106cc

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

scripts/protoc_installer.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
#!/bin/bash
2-
# Install protoc
2+
# Copyright 2024 gRPC authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eu -o pipefail
17+
18+
# Perform installation of protoc from source based on OS.
19+
320
PROTOC_VERSION="25.2"
421

522
# Function to download pre-built binaries for Linux with
@@ -25,10 +42,10 @@ install_protoc() {
2542
die "Unsupported architecture. Please consider manual installation."
2643
fi
2744
# Detect the Operating System
28-
OS=$(uname -s)
29-
case "$OS" in
45+
case "$(uname -s)" in
3046
"Darwin") download_binary $ARCH "osx" "$1";;
3147
"Linux") download_binary $ARCH "linux" $1;;
32-
*) echo "Unsupported operating system. Please consider manual installation." ;;
48+
*) echo "Please consider manual installation from \
49+
https://github.com/protocolbuffers/protobuf/releases/ and add to PATH" ;;
3350
esac
3451
}

0 commit comments

Comments
 (0)