summaryrefslogtreecommitdiff
path: root/scripts/generate.sh
blob: f54988037c1bea58436870cc60c800330ff9ac62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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