File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ set -e
23
34# Check if source directory path is provided
45if [ $# -eq 0 ]; then
@@ -32,7 +33,16 @@ process_file() {
3233 env_value=" ${! var_name} "
3334
3435 if [[ -n " $env_value " ]]; then
36+ # Special handling for CIS_CREDENTIAL or similar JSON structures
37+ if [[ " $var_name " == " CIS_CREDENTIAL" ]] || [[ " $var_name " == " CIS_CENTRAL_BINDING" ]]; then
38+
39+ # Process with jq and then clean up the escaped newlines
40+ clean_value=$( echo " $env_value " | jq -c .)
41+ line=" ${line// INJECT_ENV.${var_name} / ${clean_value} } "
42+ else
43+ # For non-JSON variables, use direct substitution
3544 line=" ${line// INJECT_ENV.${var_name} / ${env_value} } "
45+ fi
3646 else
3747 echo " Warning: Environment variable $var_name is not set or empty. Leaving placeholder unchanged."
3848 fi
You can’t perform that action at this time.
0 commit comments