Skip to content

Commit

Permalink
Merge pull request #2801 from mquinnfd/prebuild-yarn-warning
Browse files Browse the repository at this point in the history
Provide warning for local installs where yarn is not present
  • Loading branch information
cyberw authored Jul 10, 2024
2 parents 54a8b3d + 986e59f commit 27e6eab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pre_build.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import os
import subprocess
from shutil import which
from sys import exit


def build() -> None:
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 27e6eab

Please sign in to comment.