esp-idf/tools/ci/check_examples_rom_header.sh
Ivan Grokhotkov e94288da31 global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs
Using the method from @cemeyer
(https://github.com/espressif/esp-idf/pull/3166):

find . -name \*.sh -exec sed -i "" -e 's|^#!.*bin/bash|#!/usr/bin/env bash|' {} +

Closes https://github.com/espressif/esp-idf/pull/3166.
2020-04-03 01:10:02 +02:00

20 lines
449 B
Bash
Executable File

#!/usr/bin/env bash
# Examples shouldn't include rom headers directly
output=$(find ${IDF_PATH}/examples -name "*.[chS]" -o -name "*.cpp" -not -path "**/build/**")
files=$(egrep ".*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