From f3aa3c811227a630d5717bae5b4487528536f5dd Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 7 Jul 2024 12:56:17 -0700 Subject: [PATCH] fix output_award function in certain bin files Repaired the output_award function in `bin/gen-years.sh` and `bin/output-year-index.sh`. Previous modifications to the output_award function made is impossible to detect if output was empty. Modifications also ran counter the Unix concept that a function should ideally to one thing and one thing well. Changed so that the code that called the output_award function would decorate the award with bold markdown syntax. Changed `bin/gen-years.sh` VERSION from "1.3.2 2024-05-19" to "1.3.3 2024-07-07". Changed `bin/output-year-index.sh` VERSION from "1.4.1 2024-04-28" to "1.4.2 2024-07-07". Ran `make www` to perform the above and test under macOS. --- bin/gen-years.sh | 6 +++--- bin/output-year-index.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/gen-years.sh b/bin/gen-years.sh index 92649d03c..2a59d88db 100755 --- a/bin/gen-years.sh +++ b/bin/gen-years.sh @@ -85,7 +85,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # set variables referenced in the usage message # -export VERSION="1.3.2 2024-05-19" +export VERSION="1.3.3 2024-07-07" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -227,7 +227,7 @@ function output_award echo "$0: ERROR: in output_award: no award found in .entry.json file: $ENTRY_JSON_PATH" 1>&2 return 5 fi - echo "**$AWARD_STRING**" + echo "$AWARD_STRING" return 0 } @@ -797,7 +797,7 @@ for YYYY in $("$TAC_TOOL" "$TOP_FILE"); do # output markdown for this entry # - echo "*
[**$YYYY_DIR**]($YYYY_DIR/index.html) - $AWARD
" + echo "*
[**$YYYY_DIR**]($YYYY_DIR/index.html) - **$AWARD**
" done | if [[ -z $NOOP ]]; then cat >> "$TMP_YEARS_MD" else diff --git a/bin/output-year-index.sh b/bin/output-year-index.sh index 6f424fb54..056c4e8cc 100755 --- a/bin/output-year-index.sh +++ b/bin/output-year-index.sh @@ -110,7 +110,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # set variables referenced in the usage message # -export VERSION="1.4.1 2024-04-28" +export VERSION="1.4.2 2024-07-07" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -222,7 +222,7 @@ function output_award echo "$0: ERROR: in output_award: no award found in .entry.json file: $ENTRY_JSON_PATH" 1>&2 return 5 fi - echo "**$AWARD_STRING**" + echo "$AWARD_STRING" return 0 } @@ -648,7 +648,7 @@ for YYYY_DIR in $(< "$YEAR_FILE"); do # ENTRY_NAME=$(basename "$YYYY_DIR") export ENTRY_NAME - echo "* [**$YYYY_DIR**]($ENTRY_NAME/index.html) - $AWARD" + echo "* [**$YYYY_DIR**]($ENTRY_NAME/index.html) - **$AWARD**" done | if [[ -z $NOOP ]]; then cat >> "$TMP_FILE" else