Skip to content

Commit

Permalink
fix output_award function in certain bin files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lcn2 committed Jul 7, 2024
1 parent 892f7da commit f3aa3c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bin/gen-years.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bin/output-year-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f3aa3c8

Please sign in to comment.