check_examples_rom_header.sh 449 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. # Examples shouldn't include rom headers directly
  3. output=$(find ${IDF_PATH}/examples -name "*.[chS]" -o -name "*.cpp" -not -path "**/build/**")
  4. files=$(egrep ".*include.*\<rom\>.*h" ${output} | cut -d ":" -f 1)
  5. found_rom=0
  6. for file in ${files}
  7. do
  8. echo "${file} contains rom headers!"
  9. found_rom=`expr $found_rom + 1`;
  10. done
  11. if [ $found_rom -eq 0 ]; then
  12. echo "No rom headers found in examples"
  13. exit 0
  14. fi
  15. exit 1