@@ -259,6 +259,7 @@ if [ -f "$FUNCTION_SQL_FILE" ]; then
259
259
" Comparison"
260
260
" Conditional"
261
261
" Distance"
262
+ " Dates and Times"
262
263
)
263
264
264
265
for CATEGORY in " ${FUNCTION_CATEGORIES[@]} " ; do
@@ -271,15 +272,16 @@ if [ -f "$FUNCTION_SQL_FILE" ]; then
271
272
}
272
273
273
274
# Rename the temporary output file to the correct name
274
- CATEGORY_LOWER=$( echo " $CATEGORY " | tr ' [:upper:]' ' [:lower:]' )
275
+ CATEGORY_LOWER=$( echo " $CATEGORY " | tr ' [:upper:]' ' [:lower:]' | tr ' ' ' _ ' )
275
276
if [ -f " temp-functions.md" ]; then
277
+ echo " ${CATEGORY_LOWER} -functions.md"
276
278
mv " temp-functions.md" " ${CATEGORY_LOWER} -functions.md" || {
277
279
echo " [$SCRIPT_NAME ] Error: Failed to rename temp-functions.md to ${CATEGORY_LOWER} -functions.md"
278
280
exit 1
279
281
}
280
282
echo " [$SCRIPT_NAME ] Generated ${CATEGORY_LOWER} -functions.md"
281
283
else
282
- echo " [$SCRIPT_NAME ] Warning: temp-functions.md not found after processing $CATEGORY functions "
284
+ echo " [$SCRIPT_NAME ] Warning: temp-functions.md not found for $CATEGORY "
283
285
fi
284
286
done
285
287
else
@@ -360,7 +362,9 @@ insert_src_files=(
360
362
" comparison-functions.md"
361
363
" conditional-functions.md"
362
364
" distance-functions.md"
365
+ " dates_and_times-functions.md"
363
366
)
367
+
364
368
insert_dest_files=(
365
369
" docs/about-us/beta-and-experimental-features.md"
366
370
" docs/sql-reference/functions/arithmetic-functions.md"
@@ -370,8 +374,10 @@ insert_dest_files=(
370
374
" docs/sql-reference/functions/comparison-functions.md"
371
375
" docs/sql-reference/functions/conditional-functions.md"
372
376
" docs/sql-reference/functions/distance-functions.md"
377
+ " docs/sql-reference/functions/date-time-functions.md"
373
378
)
374
- echo " [$SCRIPT_NAME ] Inserting generated markdown content between <!-- AUTOGENERATED_START --> <!-- AUTOGENERATED_END --> tags"
379
+
380
+ echo " [$SCRIPT_NAME ] Inserting generated markdown content between AUTOGENERATED_START and AUTOGENERATED_END tags"
375
381
for i in " ${! insert_src_files[@]} " ; do
376
382
src_file=" ${insert_src_files[i]} "
377
383
@@ -394,18 +400,18 @@ for i in "${!insert_src_files[@]}"; do
394
400
trap ' rm -f "$tmp_file"' EXIT
395
401
396
402
# 1. Copy everything up to and including <!--AUTOGENERATED_START-->
397
- awk ' /<!--AUTOGENERATED_START-->/ {print; exit}; {print} ' " $dest_full_path " > " $tmp_file "
403
+ sed -n ' 1, /<!--AUTOGENERATED_START-->/p ' " $dest_full_path " > " $tmp_file "
398
404
399
405
# 2. Add the content from the source file
400
406
cat " $src_rel_path " >> " $tmp_file "
401
407
402
408
# 3. Add everything from <!--AUTOGENERATED_END--> to the end of the file
403
- awk ' BEGIN {found=0}; /<!--AUTOGENERATED_END-->/ {found=1}; found {print} ' " $dest_full_path " >> " $tmp_file "
409
+ sed -n ' /<!--AUTOGENERATED_END-->/,$p ' " $dest_full_path " >> " $tmp_file "
404
410
405
411
# Replace the original file with the modified content
406
412
mv " $tmp_file " " $dest_full_path "
407
413
else
408
- echo " [$SCRIPT_NAME ] Error: Expected to find <!-- AUTOGENERATED_START--> and <!-- AUTOGENERATED_END--> tags in $dest_full_path , but did not"
414
+ echo " [$SCRIPT_NAME ] Error: Expected to find AUTOGENERATED_START and AUTOGENERATED_END tags in $dest_full_path , but did not"
409
415
exit 1
410
416
fi
411
417
@@ -424,7 +430,7 @@ cd "$parent_of_tmp" || echo "[$SCRIPT_NAME] Warning: Failed to cd back to parent
424
430
echo " [$SCRIPT_NAME ] Removing contents of temporary directory: $tmp_dir "
425
431
# Use full path for removal just in case cd failed
426
432
rm -rf " $tmp_dir " /*
427
- rmdir " $tmp_dir " 2> /dev/null || echo " [$SCRIPT_NAME ] Info: Did not remove $tmp_dir (might contain hidden files or already gone). "
433
+ rmdir " $tmp_dir " 2> /dev/null || echo " [$SCRIPT_NAME ] Unable to remove $tmp_dir "
428
434
429
435
echo " [$SCRIPT_NAME ] Auto-generation of settings markdown pages completed successfully."
430
436
exit 0
0 commit comments