tools/check-includes.sh: make shellcheck happy.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-12-04 21:54:58 +10:30
parent c3899806ee
commit 186b895440

View File

@ -21,7 +21,7 @@ do
EXIT_CODE=1
fi
# Ignore contrib/.
if [ "${HEADER_FILE##contrib/}" = "$HEADER_FILE" -a "$(grep '#include' $HEADER_FILE | head -n1)" != '#include "config.h"' ]; then
if [ "${HEADER_FILE##contrib/}" = "$HEADER_FILE" ] && [ "$(grep '#include' "$HEADER_FILE" | head -n1)" != '#include "config.h"' ]; then
echo "${HEADER_FILE}:1:does not include config.h first"
EXIT_CODE=1
fi
@ -68,7 +68,7 @@ for C_FILE in $(filter_suffix c); do
EXIT_CODE=1
fi
# Ignore contrib/.
if [ "${C_FILE##contrib/}" = "$C_FILE" -a "$(grep '#include' $C_FILE | head -n1)" != '#include "config.h"' ]; then
if [ "${C_FILE##contrib/}" = "$C_FILE" ] && [ "$(grep '#include' "$C_FILE" | head -n1)" != '#include "config.h"' ]; then
echo "${C_FILE}:1:does not include config.h first"
EXIT_CODE=1
fi