1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/dist/tools/examples_check/check_has_readme.sh
AnnsAnn 83e93a5b73 ci: Add tests for examples folder
examples/readme: add missing entries

examples: document examples with no readme
2024-11-12 16:35:26 +01:00

28 lines
686 B
Bash
Executable File

#!/bin/bash
# Path to the examples directory
EXAMPLES_DIR="$(dirname "$0")/../../../examples"
# Get a list of all directories in the examples directory
directories=$(find "$EXAMPLES_DIR" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)
# Check each directory
missing_entries=()
for dir in $directories; do
if [ ! -f "$EXAMPLES_DIR/$dir/README.md" ]; then
missing_entries+=("$dir")
fi
done
# Report missing entries
if [ ${#missing_entries[@]} -eq 0 ]; then
echo "All examples have a README"
exit 0
else
echo "The following directories are missing a README:"
for entry in "${missing_entries[@]}"; do
echo "- $entry"
done
exit 1
fi