mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 09:19:41 +08:00
.env file ignore blank lines and comments
This commit is contained in:
@@ -130,6 +130,9 @@ def load_dot_env_file(dot_env_path: Text) -> Dict:
|
|||||||
with open(dot_env_path, mode="rb") as fp:
|
with open(dot_env_path, mode="rb") as fp:
|
||||||
for line in fp:
|
for line in fp:
|
||||||
# maxsplit=1
|
# maxsplit=1
|
||||||
|
line = line.strip()
|
||||||
|
if not len(line) or line.startswith(b"#"):
|
||||||
|
continue
|
||||||
if b"=" in line:
|
if b"=" in line:
|
||||||
variable, value = line.split(b"=", 1)
|
variable, value = line.split(b"=", 1)
|
||||||
elif b":" in line:
|
elif b":" in line:
|
||||||
|
|||||||
Reference in New Issue
Block a user