From 4ee434b60b59fade06804fa803f5cc8dce07cd89 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 2 Aug 2022 11:42:34 +0200 Subject: [PATCH] Allow blanks in additional apps https://github.com/alexbelgium/hassio-addons/issues/411 --- .../rootfs/etc/cont-init.d/99-add_packages.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh b/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh index 75bc7a9ba..2ec006b3c 100644 --- a/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh +++ b/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh @@ -14,11 +14,15 @@ fi # Install specific apps if bashio::config.has_value 'additional_apps'; then bashio::log.info "Installing additional apps :" - # hadolint ignore=SC2005 - NEWAPPS=$(bashio::config 'additional_apps') - for APP in ${NEWAPPS//,/ }; do - bashio::log.green "... $APP" - # shellcheck disable=SC2015 - apk add --no-cache "$APP" >/dev/null || bashio::log.red "... not successful, please check package name" + NEWAPPS="$(bashio::config 'additional_apps')" + IFS="," + re='^( *).*' + read -ra array <<< "$NEWAPPS" + for element in "${array[@]}" + do + APP="${element#${BASH_REMATCH[1]}}" + [[ $element =~ $re ]] && \ + bashio::log.green "... $APP" && \ + apk add --no-cache "$APP" || bashio::log.red "... not successful, please check $APP package name" done fi