Allow blanks in additional apps

https://github.com/alexbelgium/hassio-addons/issues/411
This commit is contained in:
Alexandre
2022-08-02 11:42:34 +02:00
committed by GitHub
parent bab5feb8cc
commit 4ee434b60b

View File

@@ -14,11 +14,15 @@ fi
# Install specific apps # Install specific apps
if bashio::config.has_value 'additional_apps'; then if bashio::config.has_value 'additional_apps'; then
bashio::log.info "Installing additional apps :" bashio::log.info "Installing additional apps :"
# hadolint ignore=SC2005 NEWAPPS="$(bashio::config 'additional_apps')"
NEWAPPS=$(bashio::config 'additional_apps') IFS=","
for APP in ${NEWAPPS//,/ }; do re='^( *).*'
bashio::log.green "... $APP" read -ra array <<< "$NEWAPPS"
# shellcheck disable=SC2015 for element in "${array[@]}"
apk add --no-cache "$APP" >/dev/null || bashio::log.red "... not successful, please check package name" 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 done
fi fi