Skip to content

Commit

Permalink
split prebuild commands to avoid using shell, skip first
Browse files Browse the repository at this point in the history
  • Loading branch information
mquinnfd committed Jul 10, 2024
1 parent f7a142e commit 986e59f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pre_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@


def build() -> None:
if which("yarn") is None:
print("Locust requires the yarn binary to be available in this shell to build the web front-end.\nSee: https://docs.locust.io/en/stable/developing-locust.html#making-changes-to-locust-s-web-ui")
exit(1)
if os.environ.get("SKIP_PRE_BUILD", "") == "true":
print("Skipping front end build...")
return
if which("yarn") is None:
print(
"Locust requires the yarn binary to be available in this shell to build the web front-end.\nSee: https://docs.locust.io/en/stable/developing-locust.html#making-changes-to-locust-s-web-ui"
)
exit(1)
print("Building front end...")
subprocess.run(["make", "frontend_build"])
subprocess.run(["yarn", "webui:install"])
subprocess.run(["yarn", "webui:build"])


if __name__ == "__main__":
Expand Down

0 comments on commit 986e59f

Please sign in to comment.