Skip to content

Commit

Permalink
Allow lower case vars in env_rename
Browse files Browse the repository at this point in the history
  • Loading branch information
CLHatch committed Jun 7, 2024
1 parent c7cc4d8 commit 4294686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .scripts/env_rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ IFS=$'\n\t'
env_rename() {
local FROMVAR=${1-}
local TOVAR=${2-}
if grep -q -i -P "^\s*${FROMVAR}\s*=" "${COMPOSE_ENV}"; then
if grep -q -P "^\s*${FROMVAR}\s*=" "${COMPOSE_ENV}"; then
notice "Renaming ${FROMVAR} to ${TOVAR} in ${COMPOSE_ENV} file."
sed -i "s/^\s*${FROMVAR}\s*=/${TOVAR}=/i" "${COMPOSE_ENV}" || fatal "Failed to rename var from ${FROMVAR} to ${TOVAR}\nFailing command: ${F[C]}sed -i \"s/^\\s*${FROMVAR}\\s*=/${TOVAR}=/\" \"${COMPOSE_ENV}\""
sed -i "s/^\s*${FROMVAR}\s*=/${TOVAR}=/" "${COMPOSE_ENV}" || fatal "Failed to rename var from ${FROMVAR} to ${TOVAR}\nFailing command: ${F[C]}sed -i \"s/^\\s*${FROMVAR}\\s*=/${TOVAR}=/\" \"${COMPOSE_ENV}\""
fi
}

Expand Down

0 comments on commit 4294686

Please sign in to comment.