You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
833 B
Bash
21 lines
833 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# shellcheck disable=SC1090
|
|
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
|
|
|
VERSION=${VERSION:-2.15.0}
|
|
DEST="${XDG_DATA_HOME}/apps/releases/protoc-grpc-gateway"
|
|
BASE_URL=https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${VERSION}
|
|
GRPC_GATEWAY_URL=${BASE_URL}/protoc-gen-grpc-gateway-v${VERSION}-$(get_os)-$(uname -m)
|
|
OPENAPI_V2_URL=${BASE_URL}/protoc-gen-openapiv2-v${VERSION}-$(get_os)-$(uname -m)
|
|
|
|
extract_binary "${GRPC_GATEWAY_URL}" "${DEST}/${VERSION}/protoc-gen-grpc-gateway"
|
|
extract_binary "${OPENAPI_V2_URL}" "${DEST}/${VERSION}/protoc-gen-openapiv2"
|
|
|
|
set_current_link "${DEST}" "${VERSION}"
|
|
|
|
set_link "${XDG_BIN_HOME}/protoc-gen-grpc-gateway" "${DEST}" protoc-gen-grpc-gateway
|
|
set_link "${XDG_BIN_HOME}/protoc-gen-openapiv2" "${DEST}" protoc-gen-openapiv2
|