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.
This commit is contained in:
Landon Curt Noll committed 2024-07-07 12:56:17 -07:00
1 parent 892f7daf41
commit f3aa3c8112
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -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 "* <div id=\"${YEAR_DIR}_${ENTRY_DIR}\">[**$YYYY_DIR**]($YYYY_DIR/index.html) - $AWARD</div>"
echo "* <div id=\"${YEAR_DIR}_${ENTRY_DIR}\">[**$YYYY_DIR**]($YYYY_DIR/index.html) - **$AWARD**</div>"
done | if [[ -z $NOOP ]]; then
cat >> "$TMP_YEARS_MD"
else
+3 -3
View File
@@ -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