#!/bin/bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DEPLOY_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" if command -v buf &>/dev/null; then echo "buf found locally, generating directly..." cd "$DEPLOY_DIR/../proto" buf generate --template buf.gen.backend.yaml buf generate --template buf.gen.collab-go.yaml buf generate --template buf.gen.frontend.yaml buf generate --template buf.gen.node.yaml echo "Proto generation complete." else echo "buf not found locally, using proto-gen container..." docker compose -f "$DEPLOY_DIR/docker-compose.dev.yml" run --rm proto-gen fi