18 lines
495 B
Bash
18 lines
495 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
FILE="services/auth/src/app/schemas/user.py"
|
|
[ -f "$FILE" ] || { echo "Not found: $FILE"; exit 1; }
|
|
|
|
tmp="$(mktemp)"
|
|
awk '
|
|
BEGIN{incls=""}
|
|
/^class (UserRead|UserPublic|UserOut|UserResponse)\b/ {incls=$1}
|
|
incls!="" && /email: *EmailStr/ { sub(/EmailStr/, "str") }
|
|
/^class [A-Za-z_0-9]+\b/ && $2!=incls { incls="" }
|
|
{ print }
|
|
' "$FILE" > "$tmp" && mv "$tmp" "$FILE"
|
|
|
|
echo "[auth] rebuilding..."
|
|
docker compose build auth
|
|
docker compose restart auth |