File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ if [ -f "$FUNCTION_SQL_FILE" ]; then
272
272
}
273
273
274
274
# Rename the temporary output file to the correct name
275
+ # Category can be "Dates and Times" for example, resulting in `dates and times-functions.md` so we change spaces to underscores
275
276
CATEGORY_LOWER=$( echo " $CATEGORY " | tr ' [:upper:]' ' [:lower:]' | tr ' ' ' _' )
276
277
if [ -f " temp-functions.md" ]; then
277
278
echo " ${CATEGORY_LOWER} -functions.md"
@@ -400,13 +401,13 @@ for i in "${!insert_src_files[@]}"; do
400
401
trap ' rm -f "$tmp_file"' EXIT
401
402
402
403
# 1. Copy everything up to and including <!--AUTOGENERATED_START-->
403
- sed -n ' 1, /<!--AUTOGENERATED_START-->/p ' " $dest_full_path " > " $tmp_file "
404
+ awk ' /<!--AUTOGENERATED_START-->/ {print; exit}; {print} ' " $dest_full_path " > " $tmp_file "
404
405
405
406
# 2. Add the content from the source file
406
407
cat " $src_rel_path " >> " $tmp_file "
407
408
408
409
# 3. Add everything from <!--AUTOGENERATED_END--> to the end of the file
409
- sed -n ' /<!--AUTOGENERATED_END-->/,$p ' " $dest_full_path " >> " $tmp_file "
410
+ awk ' BEGIN {found=0}; /<!--AUTOGENERATED_END-->/ {found=1}; found {print} ' " $dest_full_path " >> " $tmp_file "
410
411
411
412
# Replace the original file with the modified content
412
413
mv " $tmp_file " " $dest_full_path "
You can’t perform that action at this time.
0 commit comments