aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/protoc.sh
blob: 5771b9561b1a64eba3c754a9d2be21e3b86fbd65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env sh

set -eu

URL='https://raw.githubusercontent.com/google/nsjail/2.9/config.proto'
SRC_DIR='snekbox'
FILE_NAME='config'
PROTO_PATH="${SRC_DIR}/${FILE_NAME}.proto"

curl -SsL "${URL}" -o "${PROTO_PATH}"
protoc --proto_path="${SRC_DIR}" --python_out="${SRC_DIR}" "${PROTO_PATH}"

rm -f "${PROTO_PATH}"
mv -f "${SRC_DIR}/${FILE_NAME}_pb"*.py "${SRC_DIR}/${FILE_NAME}.py"