star-ty

Generate content for online publication
git clone git://git.meso-star.fr/star-ty.git
Log | Files | Refs | README | LICENSE

commit 20bf1dcb2667e60220b898be17c267aadf756919
parent ae8dc2439f790a6181a69543349c890103b6ef4d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 24 Sep 2025 12:47:30 +0200

Do not generate empty Makefile rules for hooks

If no hooks or dynamic content exist in a section, sty-hooks will not
generate anything for that section. Previously, a completely empty rule
was printed, with no target or prerequisites, containing only a ':'
character that did not define anything.

Diffstat:
Msrc/sty-hooks | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/sty-hooks b/src/sty-hooks @@ -52,7 +52,10 @@ sections | while read -r i; do # hook's output, but rather the intermediate Markdown dynamically # generated by the script, whose output may depend on the execution of # hooks. - printf '%s: %s\n' "${shtml_section}" "${hook_section}" + if [ -n "${shtml_section}" ] \ + && [ -n "${hook_section}" ]; then + printf '%s: %s\n' "${shtml_section}" "${hook_section}" + fi done printf '%s' "${hook}" | while read -r i; do