Files
Sipro-Marketplaces/generate_grpc.sh

28 lines
662 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e
# Переход в репозиторий с proto-файлами
cd ./api/proto/v1
# Коммит и пуш изменений, если они есть
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "Update proto definitions"
git push
else
echo "No changes to commit in Sipro-Marketplaces-Protos"
fi
# Возврат в корень проекта
cd -
# Генерация .pb.go файлов в папки согласно структуре .proto
protoc \
--go_out=./api/generated/v1 \
--go-grpc_out=./api/generated/v1 \
-I./api/proto/v1 \
./api/proto/v1/*/*.proto
echo "Generation complete."