Skip to content

Instantly share code, notes, and snippets.

@yinyin
Created September 24, 2018 17:34
Show Gist options
  • Save yinyin/5b15a01edf119486bdcb44d1bacf24b1 to your computer and use it in GitHub Desktop.
Save yinyin/5b15a01edf119486bdcb44d1bacf24b1 to your computer and use it in GitHub Desktop.
Set environment variables for Protocol Buffer
#!/bin/bash
# source ~/bin/env-protobuf.sh
OPT_BASE=~/bin/app
which protoc
if [ "$?" != "0" ]; then
export PATH=$PATH:${OPT_BASE}/protobuf-3.6.1/bin
echo "PATH=${PATH}"
fi
#!/bin/bash
# source ~/bin/env-protoc-gen-go.sh
OPT_BASE=~/bin/app
source ~/bin/env-protobuf.sh
which protoc-gen-go
if [ "$?" != "0" ]; then
export PATH=$PATH:${OPT_BASE}/protoc-gen-go/bin
echo "PATH=${PATH}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment