#!/usr/bin/env bash set -euo pipefail # Run prisma generate if @prisma/client not present or if prisma schema changed if [ ! -d node_modules/@prisma/client ]; then echo "[entrypoint] @prisma/client not found — running 'npx prisma generate'" npx prisma generate --schema=./prisma/schema.prisma || true else echo "[entrypoint] @prisma/client present — skipping prisma generate" fi # Allow passing custom command, otherwise default to node dist/index.js if [ "$#" -eq 0 ]; then exec node dist/index.js else exec "$@" fi