From 54e7b890e629eea3010866aed5cd577ac82efb94 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:04:46 +0000 Subject: [PATCH] GitHub bot: fix linting issues (nobuild) --- .templates/00-global_var.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index 69628a3a7..891831dd7 100644 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -29,18 +29,18 @@ mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}") # Escape special characters using printf and enclose in double quotes sanitize_variable() { - local raw="$1" # original value - local escaped # value after printf %q - printf -v escaped '%q' "$raw" + local raw="$1" # original value + local escaped # value after printf %q + printf -v escaped '%q' "$raw" - # If nothing changed, return the original. - [[ "$raw" == "$escaped" ]] && { - printf '%s' "$raw" - return - } + # If nothing changed, return the original. + [[ "$raw" == "$escaped" ]] && { + printf '%s' "$raw" + return + } - # Otherwise protect the escaped string with double quotes. - printf '"%s"' "$escaped" + # Otherwise protect the escaped string with double quotes. + printf '"%s"' "$escaped" } for KEYS in "${arr[@]}"; do @@ -51,8 +51,8 @@ for KEYS in "${arr[@]}"; do bashio::log.warning "One of your option is an array, skipping" else # Sanitize variable - VALUE=$(sanitize_variable "$VALUE") - + VALUE=$(sanitize_variable "$VALUE") + # Continue for single values line="${KEYS}=${VALUE}" # Check if secret