Skip to content

Commit 030e9ca

Browse files
committed
Support loc in sub directory
1 parent cdc9a30 commit 030e9ca

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

support/flutter.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ DART_CODE=lib \
8080
$(if $(wildcard test/),test) \
8181
$(if $(wildcard integration_test/),integration_test)
8282

83+
# Cater for the case where the support folder is one directory up.
84+
85+
LOC := $(shell if [ -f support/loc.sh ]; then echo support/loc.sh; \
86+
elif [ -f ../support/loc.sh ]; then echo ../support/loc.sh; fi)
87+
8388
.PHONY: chrome
8489
chrome:
8590
flutter run -d chrome --release
@@ -214,7 +219,7 @@ locmax:
214219
| numfmt --grouping); \
215220
numf=$$(find lib -name "*.dart" -type f | wc -l); \
216221
output=$$(find lib -name "*.dart" -exec sh -c ' \
217-
lines=$$(bash support/loc.sh "$$1"); \
222+
lines=$$(bash $(LOC) "$$1"); \
218223
if [ $$lines -gt $(LINES) ]; then \
219224
printf "%4d %s\n" $$lines "$$1"; \
220225
fi \
@@ -243,7 +248,7 @@ locmax-enforce:
243248
| numfmt --grouping); \
244249
numf=$$(find lib -name "*.dart" -type f | wc -l); \
245250
output=$$(find lib -name "*.dart" -exec sh -c ' \
246-
lines=$$(bash support/loc.sh "$$1"); \
251+
lines=$$(bash $(LOC) "$$1"); \
247252
if [ $$lines -gt $(LINES) ]; then \
248253
printf "%4d %s\n" $$lines "$$1"; \
249254
fi \

0 commit comments

Comments
 (0)