Skip to content

Commit c06be50

Browse files
committed
makefile: update sql reformat to use in-place --fix
1 parent a3312d6 commit c06be50

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ out/packs.zip: packs out/osquery.conf
3030

3131
.PHONY: reformat
3232
reformat:
33-
find . -type f -name "*.sql" | perl -ne 'chomp; system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
33+
find . -type f -name "*.sql" -exec npx sql-formatter -l sqlite --fix {} \;
3434

3535
.PHONY: reformat-updates
3636
reformat-updates:
37-
git status -s | awk '{ print $$2 }' | grep ".sql" | perl -ne 'chomp; print("$$_\n"); system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
37+
git status -s | awk '{ print $$2 }' | grep ".sql" | xargs -n1 npx sql-formatter -l sqlite --fix
3838

3939
.PHONY: detect
4040
detect: ./out/osqtool-$(ARCH)-$(OSQTOOL_VERSION)
@@ -79,4 +79,3 @@ verify: ./out/osqtool-$(ARCH)-$(OSQTOOL_VERSION)
7979
$(SUDO) ./out/osqtool-$(ARCH)-$(OSQTOOL_VERSION) --workers 1 --max-results=0 --max-query-duration=16s --max-total-daily-duration=2h30m --max-query-daily-duration=1h verify detection
8080

8181
all: out/packs.zip
82-

0 commit comments

Comments
 (0)