mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-18 20:10:31 +02: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
|
# Escape special characters using printf and enclose in double quotes
|
||||||
sanitize_variable() {
|
sanitize_variable() {
|
||||||
local input="$1"
|
local input="$1"
|
||||||
local escaped_input
|
local escaped_input
|
||||||
printf -v escaped_input '%q' "$input"
|
printf -v escaped_input '%q' "$input"
|
||||||
escaped_input=\"${escaped_input//\'/\'\'}\"
|
escaped_input=\"${escaped_input//\'/\'\'}\"
|
||||||
echo "$escaped_input"
|
echo "$escaped_input"
|
||||||
}
|
}
|
||||||
|
|
||||||
for KEYS in "${arr[@]}"; do
|
for KEYS in "${arr[@]}"; do
|
||||||
@@ -43,10 +43,10 @@ for KEYS in "${arr[@]}"; do
|
|||||||
if [[ "$VALUE" == \[* ]]; then
|
if [[ "$VALUE" == \[* ]]; then
|
||||||
bashio::log.warning "One of your option is an array, skipping"
|
bashio::log.warning "One of your option is an array, skipping"
|
||||||
else
|
else
|
||||||
# Sanitize variable
|
# Sanitize variable
|
||||||
if [[ "$VALUE" != \'*\' ]]; then
|
if [[ "$VALUE" != \'*\' ]]; then
|
||||||
VALUE=$(sanitize_variable "$VALUE")
|
VALUE=$(sanitize_variable "$VALUE")
|
||||||
fi
|
fi
|
||||||
# Continue for single values
|
# Continue for single values
|
||||||
line="${KEYS}=${VALUE}"
|
line="${KEYS}=${VALUE}"
|
||||||
# Check if secret
|
# Check if secret
|
||||||
|
|||||||
Reference in New Issue
Block a user