OVMS3-idf/tools/ci/check_examples_rom_header.sh
suda-morris b1497f2187 exclude rom headers in examples
1. avoid including rom headers directly in examples
2. add common API interface for CRC calculation in esp_common component
2019-08-13 11:10:22 +08:00

20 lines
436 B
Bash
Executable file

#!/bin/bash
# Examples shouldn't include rom headers directly
output=$(find ${IDF_PATH}/examples -name "*.[chS]" -o -name "*.cpp" -not -path "**/build/**")
files=$(grep ".*include.*rom.*h" ${output} | cut -d ":" -f 1)
found_rom=0
for file in ${files}
do
echo "${file} contains rom headers!"
found_rom=`expr $found_rom + 1`;
done
if [ $found_rom -eq 0 ]; then
echo "No rom headers found in examples"
exit 0
fi
exit 1