mirror of
https://github.com/RYDE-WORK/full-stack-fastapi-template.git
synced 2026-01-19 13:13:25 +08:00
🐛 Fix copier to handle string vars with spaces in quotes (#631)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
f3d6b1c435
commit
a44d2fd666
@ -14,7 +14,11 @@ for line in env_content.splitlines():
|
||||
for key, value in answers.items():
|
||||
upper_key = key.upper()
|
||||
if line.startswith(f"{upper_key}="):
|
||||
new_line = line.replace(line, f"{upper_key}={value}")
|
||||
if " " in value:
|
||||
content = f"{upper_key}={value!r}"
|
||||
else:
|
||||
content = f"{upper_key}={value}"
|
||||
new_line = line.replace(line, content)
|
||||
lines.append(new_line)
|
||||
break
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user