From 4f702b70aaaef895378f832bae40adf8cdc53408 Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Fri, 5 Sep 2025 10:10:59 +0100 Subject: [PATCH] Ensure container starts if it is mounted with an empty /modules directory. (#30699) (#30705) * Set nullglob * Replace with a if statement (because we're using sh) * combine if (cherry picked from commit 1c30bec083e7460c0ca70696c644fe2a1dc5b3e0) Co-authored-by: Will Hunt --- docker/docker-entrypoint.d/18-load-element-modules.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/docker-entrypoint.d/18-load-element-modules.sh b/docker/docker-entrypoint.d/18-load-element-modules.sh index 235c4edcf2..2230fea33e 100755 --- a/docker/docker-entrypoint.d/18-load-element-modules.sh +++ b/docker/docker-entrypoint.d/18-load-element-modules.sh @@ -14,10 +14,9 @@ entrypoint_log() { mkdir -p /tmp/element-web-config cp /app/config*.json /tmp/element-web-config/ -# If there are modules to be loaded -if [ -d "/modules" ]; then +# If the module directory exists AND the module directory has modules in it +if [ -d "/modules" ] && [ "$( ls -A '/modules' )" ]; then cd /modules - for MODULE in * do # If the module has a package.json, use its main field as the entrypoint