2020-04-02 23:10:02 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-05-22 12:21:11 +00:00
|
|
|
|
2020-06-19 04:00:58 +00:00
|
|
|
set -uo pipefail
|
|
|
|
|
2019-05-22 12:21:11 +00:00
|
|
|
# Examples shouldn't include rom headers directly
|
|
|
|
|
|
|
|
output=$(find ${IDF_PATH}/examples -name "*.[chS]" -o -name "*.cpp" -not -path "**/build/**")
|
2020-06-19 04:00:58 +00:00
|
|
|
files=$(egrep ".*include.*\Wrom\W.*h" ${output} | cut -d ":" -f 1)
|
2019-05-22 12:21:11 +00:00
|
|
|
found_rom=0
|
|
|
|
for file in ${files}
|
|
|
|
do
|
|
|
|
echo "${file} contains rom headers!"
|
2020-06-19 04:00:58 +00:00
|
|
|
((found_rom++))
|
2019-05-22 12:21:11 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ $found_rom -eq 0 ]; then
|
|
|
|
echo "No rom headers found in examples"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 1
|