Forked from sofianinho/Install latest protobuf compiler on Linux x86_64
Created
December 25, 2018 11:11
-
-
Save thangchung/89c21402b8ffe047267a70d917d2a83e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROTOC_REPO="google/protobuf" | |
# Credits to: lukechilds here: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c | |
get_latest_release() { | |
URL="https://api.github.com/repos/$1/releases/latest" | |
VERSION=$(curl --silent $URL |grep '"tag_name":' |sed -E 's/.*"([^"]+)".*/\1/') | |
echo $VERSION | |
} | |
LATEST_VERSION=$(get_latest_release ${PROTOC_REPO}) | |
echo "Latest version is: ${LATEST_VERSION}" | |
_VERSION=${LATEST_VERSION:1} | |
# grab the latest version | |
curl -OL https://github.com/${PROTOC_REPO}/releases/download/${LATEST_VERSION}/protoc-${_VERSION}-linux-x86_64.zip | |
# Unzip | |
unzip protoc-${_VERSION}-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ | |
sudo mv protoc3/include/* /usr/local/include/ | |
# Optional: change owner | |
sudo chown $USER /usr/local/bin/protoc | |
sudo chown -R $USER /usr/local/include/google | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then need to install
dotnet core
latest version as well