Skip to content

Commit

Permalink
Little change in a doc and [CodeBuild]
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Dec 8, 2023
1 parent 7e4b099 commit 05236b0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def update_parameter(parameter_name: str, formatter: str) -> None:
param_formatter = ctx.params.get(parameter_name, formatter)
if param_formatter:
# Enclose in double curly brackets all other parameters in the formatting string,
# to avoid the missing parameters' error.
# to avoid the missing parameters' error. Below is an example of a formatter string
# before and after applying the regex, assuming the current parameter is 'version'.
# 'something-with-{version}/tailored-for-{user}' => 'something-with-{version}/tailored-for-{{user}}'
pattern = r'\{(?!' + param.name + r'\})\w+\}'
param_formatter = re.sub(pattern, lambda m: f'{{{m.group(0)}}}', param_formatter)
kwargs = {param.name: value}
Expand Down

0 comments on commit 05236b0

Please sign in to comment.