File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,18 @@ REQUIRE_HTTPS_URL_PATTERN \
33
33
ICHUB_BACKEND_URL \
34
34
"
35
35
36
- # Execute envsubst with the defined variables
37
- envsubst " $( printf ' ${%s} ' $vars ) " < " $source_file " > " $target_file "
36
+ # base sed command: output source file and remove javascript comments
37
+ sed_command=" cat ${source_file} | sed -e \" s@^\\ \s*//.*@@g\" "
38
+
39
+ set -- $vars
40
+ while [ -n " $1 " ]; do
41
+ var=$1
42
+ # add a replace expression for each variable
43
+ sed_command=" ${sed_command} -e \" s@${var} :\s*\\\" .*\\\" @${var} : \\\"\$ {${var} }\\\" @g\" "
44
+ shift
45
+ done
46
+
47
+ # execute the built replace command and write to target file
48
+ echo ${sed_command} | sh > ${target_file}
38
49
39
50
echo " Variables injected correctly in $target_file "
You can’t perform that action at this time.
0 commit comments