mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
GitHub bot: fix linting issues (nobuild)
This commit is contained in:
@@ -29,11 +29,11 @@ mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}")
|
||||
|
||||
# Escape special characters using printf and enclose in double quotes
|
||||
sanitize_variable() {
|
||||
local input="$1"
|
||||
local escaped_input
|
||||
printf -v escaped_input '%q' "$input"
|
||||
escaped_input=\"${escaped_input//\'/\'\'}\"
|
||||
echo "$escaped_input"
|
||||
local input="$1"
|
||||
local escaped_input
|
||||
printf -v escaped_input '%q' "$input"
|
||||
escaped_input=\"${escaped_input//\'/\'\'}\"
|
||||
echo "$escaped_input"
|
||||
}
|
||||
|
||||
for KEYS in "${arr[@]}"; do
|
||||
@@ -43,10 +43,10 @@ for KEYS in "${arr[@]}"; do
|
||||
if [[ "$VALUE" == \[* ]]; then
|
||||
bashio::log.warning "One of your option is an array, skipping"
|
||||
else
|
||||
# Sanitize variable
|
||||
if [[ "$VALUE" != \'*\' ]]; then
|
||||
VALUE=$(sanitize_variable "$VALUE")
|
||||
fi
|
||||
# Sanitize variable
|
||||
if [[ "$VALUE" != \'*\' ]]; then
|
||||
VALUE=$(sanitize_variable "$VALUE")
|
||||
fi
|
||||
# Continue for single values
|
||||
line="${KEYS}=${VALUE}"
|
||||
# Check if secret
|
||||
|
||||
Reference in New Issue
Block a user