summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKerin Millar <kfm@plushkava.net>2024-08-13 14:15:07 +0100
committerKerin Millar <kfm@plushkava.net>2024-08-22 20:37:46 +0100
commitb0a71d9aa9b0506eabde36fde85f384af5283267 (patch)
tree4c9282f59b31667f7b289fec32d110d326e5ea6d
parentDisable shellcheck SC2153 (diff)
downloadgentoo-functions-b0a71d9aa9b0506eabde36fde85f384af5283267.tar.gz
gentoo-functions-b0a71d9aa9b0506eabde36fde85f384af5283267.tar.bz2
gentoo-functions-b0a71d9aa9b0506eabde36fde85f384af5283267.zip
Print a diagnostic message if no modules can be found
The ability to locate and source the modules depends on the genfun_basedir variable being set correctly. In the case that no modules can be found, print a useful diagnostic message and ensure that the return value is non-zero. Signed-off-by: Kerin Millar <kfm@plushkava.net>
-rw-r--r--functions.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/functions.sh b/functions.sh
index 57dfbb6..6cf7439 100644
--- a/functions.sh
+++ b/functions.sh
@@ -1060,7 +1060,10 @@ fi
# Source any modules that have been selected by the GENFUN_MODULES variable.
for _ in "${genfun_basedir}/functions"/*.sh; do
- if _want_module "$_"; then
+ if ! test -e "$_"; then
+ warn "no gentoo-functions modules were found (genfun_basedir might be set incorrectly)"
+ ! break
+ elif _want_module "$_"; then
. "$_" || return
fi
done