From 79a1ec4cc317f3b54eb402b227486462a5d01de2 Mon Sep 17 00:00:00 2001 From: librelad Date: Fri, 22 May 2026 00:34:26 +0100 Subject: [PATCH] fix(install): resolve installer function name case-insensitively dockerInstallApp built the installer name by upper-casing only the first letter of the slug (libreportal -> installLibreportal), which can't match camelCase installers like installLibrePortal. After the EasyDocker -> LibrePortal rename this broke `libreportal` installs with "installLibreportal: command not found". If the naive name isn't a defined function, resolve it case-insensitively against the function table (compgen -A function), and fail with a clear message if nothing matches. Works for any compound brand/app name. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- .../docker/app/functions/function_install_app.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/docker/app/functions/function_install_app.sh b/scripts/docker/app/functions/function_install_app.sh index 8becea0..75bcabe 100755 --- a/scripts/docker/app/functions/function_install_app.sh +++ b/scripts/docker/app/functions/function_install_app.sh @@ -9,6 +9,22 @@ dockerInstallApp() local app_name_ucfirst="$(tr '[:lower:]' '[:upper:]' <<< ${app_name:0:1})${app_name:1}" local installFuncName="install${app_name_ucfirst}" + # App slugs are lowercase (e.g. "libreportal"), but installer functions keep + # their own internal capitalisation (e.g. installLibrePortal) — capitalising + # only the first letter can't reproduce that camelCase. If the naive name + # isn't a defined function, resolve it case-insensitively against the real + # function table so any compound brand/app name (LibrePortal, …) just works. + if ! declare -F "$installFuncName" >/dev/null 2>&1; then + local _resolved + _resolved="$(compgen -A function | grep -ixF "install${app_name}" | head -n1)" + [[ -n "$_resolved" ]] && installFuncName="$_resolved" + fi + + if ! declare -F "$installFuncName" >/dev/null 2>&1; then + isError "No installer function found for app '${app_name}' (looked for ${installFuncName})." + return 1 + fi + if [[ "$reset_network" == "true" ]]; then export LIBREPORTAL_RESET_NETWORK=1 if declare -f ipRemoveFromDatabase >/dev/null 2>&1; then