From 9c2943284657403ec521f3934248e7cff3bdd059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20U=C5=9Fakl=C4=B1?= Date: Wed, 25 Feb 2026 10:59:15 -0500 Subject: [PATCH] add $plugin, convert string to array (#14014) use yarn/pnpm add --- install/docker/entrypoint.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/install/docker/entrypoint.sh b/install/docker/entrypoint.sh index a38aa4196f..98579fd68c 100755 --- a/install/docker/entrypoint.sh +++ b/install/docker/entrypoint.sh @@ -70,7 +70,7 @@ copy_or_link_files() { ln -fs "$dest_dir/$lock_file" "$src_dir/$lock_file" } -# Function to install dependencies using pnpm +# Function to install dependencies using npm/yarn/pnpm install_dependencies() { case "$PACKAGE_MANAGER" in yarn) yarn install || { @@ -174,20 +174,30 @@ debug_log() { } install_additional_plugins() { - if [[ ! -z ${NODEBB_ADDITIONAL_PLUGINS} ]]; then + if [[ -n ${NODEBB_ADDITIONAL_PLUGINS} ]]; then + # Create a local array to work with + local plugins_to_install=() + + # check if NODEBB_ADDITIONAL_PLUGINS is an array or a space-separated string + if [[ "$(declare -p NODEBB_ADDITIONAL_PLUGINS 2>/dev/null)" == "declare -a"* ]]; then + plugins_to_install=("${NODEBB_ADDITIONAL_PLUGINS[@]}") + else + plugins_to_install=(${NODEBB_ADDITIONAL_PLUGINS}) + fi + export START_BUILD="true" - for plugin in "${NODEBB_ADDITIONAL_PLUGINS[@]}"; do + for plugin in "${plugins_to_install[@]}"; do echo "Installing additional plugin ${plugin}..." case "$PACKAGE_MANAGER" in - yarn) yarn install || { + yarn) yarn add "${plugin}" || { echo "Failed to install plugin ${plugin} with yarn" exit 1 } ;; - npm) npm install || { + npm) npm install "${plugin}" || { echo "Failed to install plugin ${plugin} with npm" exit 1 } ;; - pnpm) pnpm install || { + pnpm) pnpm add "${plugin}" || { echo "Failed to install plugin ${plugin} with pnpm" exit 1 } ;;