beteran-protobuf/.devcontainer/scripts/postCreateCommand.sh
2022-07-12 07:02:38 +00:00

18 lines
852 B
Bash

#!/usr/bin/env bash
set -e
# sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && sudo apt-get -y install --no-install-recommends protobuf-compiler
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" -o /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
unzip /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip -d /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64
sudo mv /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64/bin/protoc /usr/local/bin/protoc
sudo chmod +x /usr/local/bin/protoc
sudo mkdir -p /usr/local/include/protobuf
sudo mv /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64/include/* /usr/local/include/protobuf
rm -fR /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64 /tmp/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
npm install -g ts-protoc-gen