summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/generate.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/generate.sh b/scripts/generate.sh
new file mode 100755
index 0000000..f549880
--- /dev/null
+++ b/scripts/generate.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+PROTOC_GO_PLUGIN="google.golang.org/protobuf/cmd/protoc-gen-go@latest"
+
+script="$(realpath "$0")"
+scripts="$(dirname "$script")"
+iot_core="$(dirname "$scripts")"
+proto="${iot_core}/iot-protocol/proto"
+software="${iot_core}/software"
+go_binaries="${HOME}/go/bin"
+
+generate_go_code() {
+ go install "$PROTOC_GO_PLUGIN"
+ export PATH="${PATH}:${go_binaries}"
+ protoc --proto_path="$proto" --go_out="$software" discovery.proto
+}
+
+generate_go_code