commit bbd4d5091fe85c7a8f3f939e6edc1db80d5dd2d2
parent 484b50aa91868679ede9f47a38ee2801a57264fb
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 23 Nov 2025 22:20:28 +0100
sty-hooks: correction of output when there is no hook
In the absence of a hook, the tool continued to generate makefile
targets that used an empty hook name, which led to unexpected behavior.
Note that the fix does not check whether there are no hooks at all, but
rather that the hook currently being parsed is not empty. This approach
is more robust, as the list of hooks may not be empty but may contain
empty lines that should still be ignored. This scenario should not
occur, except in the case of a bug in sty-list. In any case, there is no
reason to implement a solution that is less robust in absolute terms.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/sty-hooks b/src/sty-hooks
@@ -59,6 +59,9 @@ sections | while read -r i; do
done
printf '%s\n' "${hook}" | while read -r i; do
+ # Discard empty line
+ if [ -z "${i}" ]; then continue; fi
+
# Divide the path into two parts:
# - the top-level directory, i.e. the section
# - the shell script to be executed from the section directory