aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/protoc.sh
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2021-02-02 16:04:32 -0800
committerGravatar GitHub <[email protected]>2021-02-02 16:04:32 -0800
commitc580809b4147ee10384956bd3c0f8f082c87a426 (patch)
tree7262a361a59d2b4ac8174f5827fc8bd8aeb196b2 /scripts/protoc.sh
parentRemove trailing whitespaces from the README (diff)
parentFix typo in error message (diff)
Merge PR #88 - use protobuf to parse config
Diffstat (limited to 'scripts/protoc.sh')
-rwxr-xr-xscripts/protoc.sh14
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"