From 90f0359403fcbaffcddd49a1ca4ff55719ba95cb Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sun, 10 Jan 2021 13:26:30 -0800 Subject: Compile the NsJail config protobuf into Python code Include a helper shell script for compilation. --- scripts/protoc.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/protoc.sh (limited to 'scripts/protoc.sh') 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" -- cgit v1.2.3