Skip to content

Commit d69396e

Browse files
LasseRosenowTeufelchen1AnnsAnns
committed
dist/tools/code_in_guides_check: support subfolders
Co-authored-by: Teufelchen <[email protected]> Co-authored-by: Ann🐸 <[email protected]>
1 parent 6332834 commit d69396e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dist/tools/code_in_guides_check/check_for_code.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ parse_code_block() {
3838

3939
# Check if this code exists in any file in the source directory
4040
found=0
41-
for src_file in "$SOURCE_DIR"/*; do
42-
# Skip if not a regular file
43-
[ -f "$src_file" ] || continue
44-
41+
# Exclude `/bin/` folders
42+
INPUT_FILES=$(
43+
find "$SOURCE_DIR" \
44+
-type d -name "bin" -prune\
45+
-or -type f -print\
46+
)
47+
for src_file in $INPUT_FILES; do
4548
# Read the file content
4649
src_content=$(cat "$src_file")
4750

0 commit comments

Comments
 (0)