diff --git a/.github/scripts/check_for_missing_readme_md.sh b/.github/scripts/check_for_missing_readme_md.sh index 2cee047f7..2e2c4b4e4 100755 --- a/.github/scripts/check_for_missing_readme_md.sh +++ b/.github/scripts/check_for_missing_readme_md.sh @@ -1,13 +1,13 @@ #!/bin/sh # -# Ensure there are Readme.md files in all the project directories +# Ensure there are README.md (case insensitive name) files in all the project directories set -e #set -x fail=0 -check_string(){ +check_string() { needle=$1 if [ "$(grep "${needle}" $file | wc -l)" -eq "0" ] ; then echo In $file: missing \"${needle}\" @@ -20,14 +20,13 @@ check_string(){ fi } -MISSING=$(find projects/ -mindepth 1 -maxdepth 1 \( -path projects/common -o -path projects/scripts \) -prune -o -type d '!' -exec test -e "{}/Readme.md" ';' -print) +MISSING=$(find projects/ -mindepth 1 -maxdepth 1 \( -path projects/common -o -path projects/scripts \) -prune -o -type d '!' -exec test -e "{}/README.md" ';' -print) if [ "$(echo ${MISSING} | wc -c)" -gt "1" ] ; then - echo "Missing Readme.md files in ${MISSING}" + echo "Missing README.md files in ${MISSING}" fail=1 fi -for file in $(find projects/ -mindepth 2 -maxdepth 2 -name Readme.md) -#for file in projects/ad5766_sdz/Readme.md +for file in $(find projects/ -mindepth 2 -maxdepth 2 -iname README.md) do check_string "Board Product Page" check_string "* Parts"