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

fix: envsubst when variable contains a '&'

parent 2dabd6fc
No related branches found
No related tags found
No related merge requests found
......@@ -366,7 +366,8 @@ stages:
}
function awkenvsubst() {
awk '!/# *nosubst/{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'
# escapes '&' char in variables for gsub
awk '{while(match($0,"[$%]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH-3);val=ENVIRON[var];gsub("&","\\\\&",val);gsub("[$%]{"var"}",val)}}1'
}
# login to the hosting platform
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment