Skip to content

Commit b4739fd

Browse files
committed
Build director: define the environment just once for a set of cmds
1 parent ade425d commit b4739fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

readthedocs/doc_builder/director.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,12 @@ def run_build_job(self, job):
298298
return
299299

300300
cwd = self.data.project.checkout_path(self.data.version.slug)
301+
environment = self.vcs_environment
302+
if job not in ("pre_checkout", "post_checkout"):
303+
environment = self.build_environment
304+
301305
commands = getattr(self.data.config.build.jobs, job, [])
302306
for command in commands:
303-
environment = self.vcs_environment
304-
if job not in ("pre_checkout", "post_checkout"):
305-
environment = self.build_environment
306307
environment.run(*command.split(), escape_command=False, cwd=cwd)
307308

308309
# Helpers

0 commit comments

Comments
 (0)