feat: add api-rate-limit flag (#5013)

This commit is contained in:
Dean Sheather
2022-11-11 07:53:48 +10:00
committed by GitHub
parent 2042b575dc
commit 8e5af82275
7 changed files with 110 additions and 1 deletions

View File

@ -22,8 +22,12 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
first=true
for fi in queries/*.sql.go; do
# Find the last line from the imports section and add 1.
# Find the last line from the imports section and add 1. We have to
# disable pipefail temporarily to avoid ERRPIPE errors when piping into
# `head -n1`.
set +o pipefail
cut=$(grep -n ')' "$fi" | head -n 1 | cut -d: -f1)
set -o pipefail
cut=$((cut + 1))
# Copy the header from the first file only, ignoring the source comment.