Skip to content

Commit

Permalink
Update appvars_create.sh
Browse files Browse the repository at this point in the history
Ignore whitespace before and after variables.
  • Loading branch information
CLHatch committed Apr 22, 2024
1 parent 2bfd750 commit 9ccb749
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .scripts/appvars_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ appvars_create() {
# Actual processing starts here
info "Creating environment variables for ${APPNAME}."
for SET_VAR in "${!APP_VAR_VALUE[@]}"; do
if grep -q -P "^${SET_VAR}=" "${COMPOSE_ENV}"; then
if grep -q -P "^\s*${SET_VAR}\s*=" "${COMPOSE_ENV}"; then
# Variable already exists
continue
fi

local MIGRATE_VAR=${APP_VAR_MIGRATE["${SET_VAR}"]-}
if [[ -n ${MIGRATE_VAR} ]] && grep -q -P "^${MIGRATE_VAR}=" "${COMPOSE_ENV}"; then
if [[ -n ${MIGRATE_VAR} ]] && grep -q -P "^\s*${MIGRATE_VAR}\s*=" "${COMPOSE_ENV}"; then
# Migrate old variable
run_script 'env_rename' "${MIGRATE_VAR}" "${SET_VAR}"
else
Expand Down

0 comments on commit 9ccb749

Please sign in to comment.