Skip to content
Snippets Groups Projects
Commit f5781c83 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix: envsubst when variable contains a '&'

parent f326dac0
Branches
Tags
No related merge requests found
...@@ -351,7 +351,8 @@ stages: ...@@ -351,7 +351,8 @@ stages:
} }
function awkenvsubst() { function awkenvsubst() {
awk '{while(match($0,"[$%]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH-3);val=ENVIRON[var]; gsub(/["\\]/,"\\\\&",val); gsub("\n","\\n",val);gsub("\r","\\r",val); gsub("[$%]{"var"}",val)}}1' # performs variables escaping: '&' for gsub + JSON chars ('\' and '"')
awk '{while(match($0,"[$%]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH-3);val=ENVIRON[var];gsub(/["\\&]/,"\\\\&",val);gsub("[$%]{"var"}",val)}}1'
} }
function configure_registries_auth() { function configure_registries_auth() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment