Merge pull request #173 from tstromberg/makefile

Makefile: Add reformat-updates target
This commit is contained in:
Thomas Strömberg 2023-02-10 10:33:26 -05:00 committed by GitHub
commit 059bdbb649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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