From ad160b8e86c257492941a5b137abe292c67bb66c Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 18 Mar 2019 15:46:45 +0800 Subject: [PATCH] create .gitignore file when initializing new project --- httprunner/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/httprunner/utils.py b/httprunner/utils.py index 79d7d130..04f4778b 100644 --- a/httprunner/utils.py +++ b/httprunner/utils.py @@ -533,6 +533,12 @@ def create_scaffold(project_name): ] [create_path(p[0], p[1]) for p in path_list] + # create .gitignore file + ignore_file = os.path.join(project_name, ".gitignore") + ignore_content = ".env\nreports/*" + with open(ignore_file, "w") as f: + f.write(ignore_content) + def gen_cartesian_product(*args): """ generate cartesian product for lists