generate: container: Remove if ! [ -d dir ] from Environment.create
Remove the if ! [ -d {file.parent} ] check from Envrionment.create(), as the directory has to exists, since the script checking if it exists also is located in that directort... Signed-off-by: Enno Tensing <tenno@suij.in>
This commit is contained in:
parent
995a66c753
commit
17adc701a8
1 changed files with 0 additions and 5 deletions
|
@ -192,12 +192,7 @@ class Environment:
|
|||
|
||||
def create(self) -> str:
|
||||
"""Create env file."""
|
||||
file = Path(self.file)
|
||||
cmd = f"# Create env-file {self.file}\n"
|
||||
cmd += f"if ! [ -d '{file.parent}' ]\n"
|
||||
cmd += "then\n"
|
||||
cmd += f"\tmkdir --parents '{file.parent}'\n"
|
||||
cmd += "fi\n"
|
||||
for var in self.variables:
|
||||
escaped_var = var.replace("'", "%b")
|
||||
cmd += f"printf '{escaped_var}\\n' \"'\" >> '{self.file}'\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue