github.com/lastbackend/toolkit@v0.0.0-20241020043710-cafa37b95aad/hack/generate.sh (about)

     1  #!/bin/bash -e
     2  
     3  find . -type d -name example -prune -type f \( -name '*.pb.go' -o -name '*.pb.*.go' \) -delete
     4  
     5  mkdir -p proto/google/api
     6  
     7  curl -s -f -o proto/google/api/annotations.proto -L https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto || { echo "Error: Request failed"; exit 1; }
     8  
     9  PROTOS=$(find . -type f -name '*.proto' | grep -v examples | grep -v proto/google/api | grep -v proto/toolkit )
    10  
    11  for PROTO in $PROTOS; do
    12    protoc \
    13      -I. \
    14      -I$GOPATH/src \
    15      -I$(dirname $PROTO) \
    16      --go_out=paths=source_relative:. \
    17      $PROTO
    18  done
    19  
    20  rm -r proto
    21  
    22  echo "Generation is ok"