Skip to content

Commit

Permalink
Fix race condition when rebuilding proto files. (#813)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <[email protected]>
  • Loading branch information
cody-littley authored Oct 17, 2024
1 parent 8a67143 commit 0ee84f9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions api/builder/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

API_DIR="${SCRIPT_DIR}/.."
GRPC_DIR="${API_DIR}/grpc"
find "${GRPC_DIR}" -name '*.pb.go' -type f | xargs rm -rf

if [ -d "${GRPC_DIR}" ]; then
# Delete all compiled protobufs
find "${GRPC_DIR}" -name '*.pb.go' -type f | xargs rm -rf
# Delete all empty directories
find "${GRPC_DIR}" -type d -empty -delete
fi

DISPERSER_DIR="$SCRIPT_DIR/../../disperser"
DISPERSER_GRPC_DIR="$DISPERSER_DIR/api/grpc"
find "${DISPERSER_GRPC_DIR}" -name '*.pb.go' -type f | xargs rm -rf
if [ -d "${DISPERSER_GRPC_DIR}" ]; then
# Delete all compiled protobufs
find "${DISPERSER_GRPC_DIR}" -name '*.pb.go' -type f | xargs rm -rf
# Delete all empty directories
find "${DISPERSER_GRPC_DIR}" -type d -empty -delete
fi

0 comments on commit 0ee84f9

Please sign in to comment.