From 6df4c2cd015a0bb77f896db7ea0783f9f77689b7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:30:08 +0000 Subject: [PATCH] GitHub bot: fix linting issues (nobuild) --- .templates/00-global_var.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index 33816211d..93577b629 100644 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -29,21 +29,21 @@ 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 - # Check if the value is an array - if [[ "$raw" == \[* ]]; then - echo "One of your options is an array, skipping" - return - fi - printf -v escaped '%q' "$raw" - # If nothing changed, return the original. - if [[ "$raw" == "$escaped" ]]; then - printf '%s' "$raw" - return - fi - # Otherwise protect the escaped string with double quotes. - printf '"%s"' "$escaped" + local raw="$1" # original value + local escaped # value after printf %q + # Check if the value is an array + if [[ "$raw" == \[* ]]; then + echo "One of your options is an array, skipping" + return + fi + printf -v escaped '%q' "$raw" + # If nothing changed, return the original. + if [[ "$raw" == "$escaped" ]]; then + printf '%s' "$raw" + return + fi + # Otherwise protect the escaped string with double quotes. + printf '"%s"' "$escaped" } for KEYS in "${arr[@]}"; do