Skip to content

Commit

Permalink
Build director: define the environment just once for a set of cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Mar 16, 2022
1 parent ade425d commit b4739fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions readthedocs/doc_builder/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@ def run_build_job(self, job):
return

cwd = self.data.project.checkout_path(self.data.version.slug)
environment = self.vcs_environment
if job not in ("pre_checkout", "post_checkout"):
environment = self.build_environment

commands = getattr(self.data.config.build.jobs, job, [])
for command in commands:
environment = self.vcs_environment
if job not in ("pre_checkout", "post_checkout"):
environment = self.build_environment
environment.run(*command.split(), escape_command=False, cwd=cwd)

# Helpers
Expand Down

0 comments on commit b4739fd

Please sign in to comment.