Skip to content

Commit b84b95f

Browse files
committed
Ignore header-less Markdown files in reference generation
1 parent dd331df commit b84b95f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

documentation/analysis-reports-reference/generateJupyterReportReference.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ echo "generateJupyterReportReference: Generating ${markdown_file}..."
2424

2525
# Loop through all Markdown files in the current directory
2626
find . -type f -name "*.md" | sort | while read -r report_file; do
27-
# Extract the first non-empty line that starts with '#'
28-
report_file_header_line=$(grep -m 1 -e '^#\+.*' "${report_file}")
27+
# Extract the first non-empty line that starts with one or more '#', allowing leading spaces
28+
if ! report_file_header_line=$(grep -m 1 -e '^[[:space:]]*#\+[[:space:]]*.*' "${report_file}"); then
29+
echo "generateJupyterReportReference: Warning: No header line found in ${report_file}, skipping."
30+
continue
31+
fi
2932

3033
# Remove leading '#' characters and trim leading/trailing spaces
3134
description=$(echo "${report_file_header_line}" | sed -E 's/^#+\s*//')

0 commit comments

Comments
 (0)