You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lemmy/scripts/sql_format_check.sh

16 lines
314 B
Bash

#!/usr/bin/env bash
set -e
# This check is only used for CI.
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
cd $CWD/../
find migrations -type f -name "*.sql" -print0 | while read -d $'\0' FILE
do
TMP_FILE="/tmp/tmp_pg_format.sql"
pg_format $FILE > $TMP_FILE
diff -u $FILE $TMP_FILE
done