mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-08 16:45:56 +02:00
GitHub bot: fix linting issues (nobuild)
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
slug="${HOSTNAME/-/_}" ; slug="${slug#*_}"
|
slug="${HOSTNAME/-/_}"
|
||||||
|
slug="${slug#*_}"
|
||||||
|
|
||||||
# CONFIG FILE
|
# CONFIG FILE
|
||||||
if [[ ! -f /config/configuration.yaml && ! -f /config/configuration.json ]]; then
|
if [[ ! -f /config/configuration.yaml && ! -f /config/configuration.json ]]; then
|
||||||
@@ -31,8 +32,10 @@ fi
|
|||||||
|
|
||||||
chmod -R 755 "$(dirname "$CONFIGSOURCE")"
|
chmod -R 755 "$(dirname "$CONFIGSOURCE")"
|
||||||
|
|
||||||
HAS_PYTHON=false; command -v python3 &>/dev/null && HAS_PYTHON=true
|
HAS_PYTHON=false
|
||||||
HAS_YQ=false; command -v yq &>/dev/null && HAS_YQ=true
|
command -v python3 &>/dev/null && HAS_PYTHON=true
|
||||||
|
HAS_YQ=false
|
||||||
|
command -v yq &>/dev/null && HAS_YQ=true
|
||||||
|
|
||||||
$HAS_PYTHON || bashio::log.yellow "python3 not found – /env.py export disabled."
|
$HAS_PYTHON || bashio::log.yellow "python3 not found – /env.py export disabled."
|
||||||
$HAS_YQ || bashio::exit.nok "yq not found – script not executed."
|
$HAS_YQ || bashio::exit.nok "yq not found – script not executed."
|
||||||
@@ -79,7 +82,8 @@ while IFS= read -r LINE; do
|
|||||||
VALUE="$(get_secret "$NAME")"
|
VALUE="$(get_secret "$NAME")"
|
||||||
[[ -z "$VALUE" ]] && bashio::exit.nok "Secret '$NAME' not found in $SECRETSFILE"
|
[[ -z "$VALUE" ]] && bashio::exit.nok "Secret '$NAME' not found in $SECRETSFILE"
|
||||||
fi
|
fi
|
||||||
VALUE="${VALUE##[[:space:]]}" ; VALUE="${VALUE%%[[:space:]]}"
|
VALUE="${VALUE##[[:space:]]}"
|
||||||
|
VALUE="${VALUE%%[[:space:]]}"
|
||||||
SAFE_VALUE=$(shell_escape "$VALUE")
|
SAFE_VALUE=$(shell_escape "$VALUE")
|
||||||
export "$KEY=$VALUE"
|
export "$KEY=$VALUE"
|
||||||
if $HAS_PYTHON; then
|
if $HAS_PYTHON; then
|
||||||
|
|||||||
Reference in New Issue
Block a user