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

fix: envsubst when variable contains a '&'

parent 2165716a
No related branches found
No related tags found
No related merge requests found
...@@ -288,7 +288,8 @@ stages: ...@@ -288,7 +288,8 @@ stages:
} }
function awkenvsubst() { function awkenvsubst() {
awk '{while(match($0,"[$%]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH-3);val=ENVIRON[var]; gsub("[$%]{"var"}",val)}}1' # escapes '&' char in variables for gsub
awk '!/# *nosubst/{while(match($0,"[$%]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH-3);val=ENVIRON[var];gsub("&","\\\\&",val);gsub("[$%]{"var"}",val)}}1'
} }
function pre_apply() { function pre_apply() {
......
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