From 6701f5389b465fc283160dae51b7b7b28e4c9f36 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sat, 13 Jan 2024 15:14:03 -0500 Subject: [PATCH] Added code to only add the date to the metadata array if it isn't already present --- build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 564fecd..9db6d06 100755 --- a/build.sh +++ b/build.sh @@ -58,8 +58,10 @@ convert_to_array() { } add_date_to_array() { - meta_array["date"]="$(date -r $1 +'%b %d, %Y')" - + if test -z "${meta_array[date]}"; then # If there is no existing date in the metadata + meta_array["date"]="$(date -r $1 +'%b %d, %Y')" + fi + echo "${meta_array[date]}" } add_header_and_footer() {