diff options
author | 2021-02-02 16:04:32 -0800 | |
---|---|---|
committer | 2021-02-02 16:04:32 -0800 | |
commit | c580809b4147ee10384956bd3c0f8f082c87a426 (patch) | |
tree | 7262a361a59d2b4ac8174f5827fc8bd8aeb196b2 /scripts/protoc.sh | |
parent | Remove trailing whitespaces from the README (diff) | |
parent | Fix typo in error message (diff) |
Merge PR #88 - use protobuf to parse config
Diffstat (limited to 'scripts/protoc.sh')
-rwxr-xr-x | scripts/protoc.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/protoc.sh b/scripts/protoc.sh new file mode 100755 index 0000000..5771b95 --- /dev/null +++ b/scripts/protoc.sh @@ -0,0 +1,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" |