github.com/psiphon-labs/goarista@v0.0.0-20160825065156-d002785f4c67/openconfig/gen.sh (about) 1 #!/bin/sh 2 # Copyright (C) 2016 Arista Networks, Inc. 3 # Use of this source code is governed by the Apache License 2.0 4 # that can be found in the COPYING file. 5 6 # Fix up protobuf imports 7 8 go get -u github.com/golang/protobuf/protoc-gen-go 9 protoc --go_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. openconfig.proto 10 11 if ! egrep "Copyright \d+ Google" openconfig.pb.go 12 then 13 egrep -A 12 "Copyright \d+ Google" openconfig.proto | cat - openconfig.pb.go > /tmp/pb.go && mv /tmp/pb.go openconfig.pb.go 14 fi