From a1909940980fce4efd710a6cff9f874ae7ffa9d0 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Mon, 11 Apr 2022 17:35:11 +0200 Subject: [PATCH] Add envvar to enable automatic .gitignore creation for workdirs --- sbysrc/sby.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbysrc/sby.py b/sbysrc/sby.py index 5616bc0..d28cd29 100644 --- a/sbysrc/sby.py +++ b/sbysrc/sby.py @@ -415,6 +415,10 @@ def run_task(taskname): my_opt_tmpdir = True my_workdir = tempfile.mkdtemp() + if os.getenv("SBY_WORKDIR_GITIGNORE"): + with open(f"{my_workdir}/.gitignore", "w") as gitignore: + print("*", file=gitignore) + junit_ts_name = os.path.basename(sbyfile[:-4]) if sbyfile is not None else workdir if workdir is not None else "stdin" junit_tc_name = taskname if taskname is not None else "default" -- 2.30.2