mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Framework: add lint pass to check for missing shebang
PR: https://forum.opnsense.org/index.php?topic=15827.0
This commit is contained in:
+6
-2
@@ -272,8 +272,12 @@ lint-desc: check
|
||||
fi
|
||||
|
||||
lint-shell:
|
||||
@find ${.CURDIR}/src \
|
||||
-name "*.sh" -type f -print0 | xargs -0 -n1 sh -n
|
||||
@for FILE in $$(find ${.CURDIR}/src -name "*.sh" -type f); do \
|
||||
if [ "$$(head $${FILE} | grep -c '^#!\/bin\/sh$$')" == "0" ]; then \
|
||||
echo "Missing shebang in $${FILE}"; exit 1; \
|
||||
fi; \
|
||||
sh -n $${FILE}; \
|
||||
done
|
||||
|
||||
lint-xml:
|
||||
@find ${.CURDIR}/src \
|
||||
|
||||
Reference in New Issue
Block a user