Makefile: Add reformat-updates target

This commit is contained in:
Thomas Stromberg 2023-02-10 10:33:04 -05:00
parent d3d01bd5a1
commit ebb9780036
Failed to extract signature
1 changed files with 4 additions and 0 deletions

View File

@ -24,4 +24,8 @@ out/odk-packs.zip: packs
reformat:
find . -type f -name "*.sql" | perl -ne 'chomp; system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
.PHONY: reformat-updates
reformat-updates:
git status -s | awk '{ print $$2 }' | grep ".sql" | perl -ne 'chomp; system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
all: out/odk-packs.zip