mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-17 09:25:50 +00:00
70530a8ad2
* Optimizing sql format check. * Fixing format testing. * Fixing format testing 2.
19 lines
357 B
Bash
Executable File
19 lines
357 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# This check is only used for CI.
|
|
|
|
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
cd $CWD/../
|
|
|
|
# Copy the files to a temp dir
|
|
TMP_DIR=$(mktemp -d)
|
|
cp -a migrations/. $TMP_DIR
|
|
|
|
# Format the new files
|
|
find $TMP_DIR -type f -name '*.sql' -exec pg_format -i {} +
|
|
|
|
# Diff the directories
|
|
diff -r migrations $TMP_DIR
|