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 <will@half-shot.uk>
This commit is contained in:
ElementRobot 2025-09-05 10:10:59 +01:00 committed by GitHub
parent 9f15532d12
commit 4f702b70aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,10 +14,9 @@ entrypoint_log() {
mkdir -p /tmp/element-web-config mkdir -p /tmp/element-web-config
cp /app/config*.json /tmp/element-web-config/ cp /app/config*.json /tmp/element-web-config/
# If there are modules to be loaded # If the module directory exists AND the module directory has modules in it
if [ -d "/modules" ]; then if [ -d "/modules" ] && [ "$( ls -A '/modules' )" ]; then
cd /modules cd /modules
for MODULE in * for MODULE in *
do do
# If the module has a package.json, use its main field as the entrypoint # If the module has a package.json, use its main field as the entrypoint