generate: container: Fix printf call in Environment.create
When creating the env-vars printf is called with arguments in single quotes to prevent variable and sub-shell expansions. However, only one single quote was passed as an argument to printf, but two format specifiers are present in the escpaed string. Fix this by adding another \"'\" to the variable cmd. Signed-off-by: Enno Tensing <tenno@suij.in>
This commit is contained in:
parent
5237a70f3e
commit
13ab593a59
1 changed files with 1 additions and 1 deletions
|
@ -179,7 +179,7 @@ class Environment:
|
|||
cmd = f"# Create env-file {self.file}\n"
|
||||
for var in self.variables:
|
||||
escaped_var = var.replace("'", "%b")
|
||||
cmd += f"printf '{escaped_var}\\n' \"'\" >> '{self.file}'\n"
|
||||
cmd += f"printf '{escaped_var}\\n' \"'\" \"'\" >> '{self.file}'\n"
|
||||
|
||||
return cmd
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue